diff options
author | Brad King <brad.king@kitware.com> | 2022-01-18 17:06:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-18 17:06:23 (GMT) |
commit | 8ffa7b7957bf8dd5ec48f61465a72bd7485c411c (patch) | |
tree | 1b6adab511797ebf41994809a82e7becaab3181a /Tests | |
parent | 807e0bb95c8cc9eb908907542869c6ce2ea2a561 (diff) | |
parent | b916860a488bedca1baa3e88538a047333d846f5 (diff) | |
download | CMake-8ffa7b7957bf8dd5ec48f61465a72bd7485c411c.zip CMake-8ffa7b7957bf8dd5ec48f61465a72bd7485c411c.tar.gz CMake-8ffa7b7957bf8dd5ec48f61465a72bd7485c411c.tar.bz2 |
Merge topic 'find_library-clean-env'
b916860a48 Tests: Avoid interference from environment in RunCMake.find_library
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6868
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/find_library/FromPATHEnv.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/find_library/FromPrefixPath.cmake | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_library/FromPATHEnv.cmake b/Tests/RunCMake/find_library/FromPATHEnv.cmake index c24e640..ba4dd37 100644 --- a/Tests/RunCMake/find_library/FromPATHEnv.cmake +++ b/Tests/RunCMake/find_library/FromPATHEnv.cmake @@ -1,6 +1,8 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -33,3 +35,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") diff --git a/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake b/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake index c24e640..ba4dd37 100644 --- a/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake +++ b/Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake @@ -1,6 +1,8 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -33,3 +35,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") diff --git a/Tests/RunCMake/find_library/FromPrefixPath.cmake b/Tests/RunCMake/find_library/FromPrefixPath.cmake index 04763a9..52814e8 100644 --- a/Tests/RunCMake/find_library/FromPrefixPath.cmake +++ b/Tests/RunCMake/find_library/FromPrefixPath.cmake @@ -1,7 +1,9 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") set(ENV{PATH} "") +set(ENV{CMAKE_PREFIX_PATH} "") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created") @@ -22,3 +24,4 @@ foreach(path "/does_not_exist" "/lib" "") endforeach() set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON) set(ENV{PATH} "${ENV_PATH}") +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") |