@@ -25,19 +25,21 @@ endif()
25
25
# Following block can broke build in case of cross-compilng
26
26
# but CMAKE_CROSSCOMPILING variable will be set only on project(OpenCV) command
27
27
# 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
31
40
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 ()
41
43
42
44
if (CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore )
43
45
set (WINRT TRUE )
0 commit comments