Skip to content

Commit 47ae5f1

Browse files
committed
Merge pull request opencv#8186 from Kronopath:patch-1
2 parents 156d736 + 88e54ca commit 47ae5f1

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

CMakeLists.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,21 @@ endif()
2525
# Following block can broke build in case of cross-compilng
2626
# but CMAKE_CROSSCOMPILING variable will be set only on project(OpenCV) command
2727
# so we will try to detect crosscompiling by presense of CMAKE_TOOLCHAIN_FILE
28-
if(NOT CMAKE_TOOLCHAIN_FILE)
29-
# it _must_ go before project(OpenCV) in order to work
30-
if(WIN32)
28+
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
29+
if(NOT CMAKE_TOOLCHAIN_FILE)
30+
# it _must_ go before project(OpenCV) in order to work
31+
if(WIN32)
32+
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
33+
else()
34+
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
35+
endif()
36+
else(NOT CMAKE_TOOLCHAIN_FILE)
37+
#Android: set output folder to ${CMAKE_BINARY_DIR}
38+
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" )
39+
# any crosscompiling
3140
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
32-
else()
33-
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
34-
endif()
35-
else(NOT CMAKE_TOOLCHAIN_FILE)
36-
#Android: set output folder to ${CMAKE_BINARY_DIR}
37-
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" )
38-
# any crosscompiling
39-
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
40-
endif(NOT CMAKE_TOOLCHAIN_FILE)
41+
endif(NOT CMAKE_TOOLCHAIN_FILE)
42+
endif()
4143

4244
if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
4345
set(WINRT TRUE)

0 commit comments

Comments
 (0)