summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-18 17:06:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-01-18 17:06:23 (GMT)
commit8ffa7b7957bf8dd5ec48f61465a72bd7485c411c (patch)
tree1b6adab511797ebf41994809a82e7becaab3181a /Tests/RunCMake
parent807e0bb95c8cc9eb908907542869c6ce2ea2a561 (diff)
parentb916860a488bedca1baa3e88538a047333d846f5 (diff)
downloadCMake-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/RunCMake')
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv.cmake3
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnvDebugVar.cmake3
-rw-r--r--Tests/RunCMake/find_library/FromPrefixPath.cmake3
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}")