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

Commit e57cc69

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 e57cc69

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ 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+
endif()
6977
endif()
7078

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

0 commit comments

Comments
 (0)