Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit cc2a23d

Browse files
committed
Don't override CMAKE_INSTALL_PREFIX if it is already set for us
Signed-off-by: Gregory Shimansky <[email protected]>
1 parent 67bd953 commit cc2a23d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ if(DEFINED ENV{CONDA_PREFIX})
6565
set(ENABLE_CONDA ON)
6666
set(CMAKE_SYSROOT "$ENV{CONDA_BUILD_SYSROOT}")
6767
list(APPEND CMAKE_PREFIX_PATH "$ENV{CONDA_PREFIX}")
68-
file(TO_CMAKE_PATH "$ENV{CONDA_PREFIX}" CMAKE_INSTALL_PREFIX)
68+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
69+
# When conda build is running CONDA_PREFIX points to build env
70+
# while install should happen to host env to detect new files. If
71+
# CMAKE_INSTALL_PREFIX is already defined to point to host env we
72+
# should not override it here but we override the default value
73+
# /usr/local (C:\Program Files) to conda environment location to
74+
# execute in CI.
75+
file(TO_CMAKE_PATH "$ENV{CONDA_PREFIX}" CMAKE_INSTALL_PREFIX)
76+
set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "..." FORCE)
77+
endif()
6978
endif()
7079

7180
string(TIMESTAMP HDK_BUILD_DATE "%Y%m%d")

0 commit comments

Comments
 (0)