summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-07 16:30:51 (GMT)
committerBrad King <brad.king@kitware.com>2022-03-07 16:40:30 (GMT)
commiteca72dab8bdaaa3b2571c2c4e0f448ba07167d89 (patch)
tree4da4cf08f4aa6f796eb1613cc41c75a399b78ae0 /Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake
parent7a8536e0eab97d5467dbcca9b14f1a9deaf934ae (diff)
downloadCMake-eca72dab8bdaaa3b2571c2c4e0f448ba07167d89.zip
CMake-eca72dab8bdaaa3b2571c2c4e0f448ba07167d89.tar.gz
CMake-eca72dab8bdaaa3b2571c2c4e0f448ba07167d89.tar.bz2
Tests: Make RunCMake.CMP0125 robust to external filesystem content
Revise the test from commit 08db1341a6 (find_*: ensure consistent behavior for cache variables, 2021-05-03, v3.21.0-rc1~177^2) to avoid searching outside the test directories. Fixes: #23299
Diffstat (limited to 'Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake')
-rw-r--r--Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake28
1 files changed, 14 insertions, 14 deletions
diff --git a/Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake b/Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake
index d2bc006..54ebda9 100644
--- a/Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake
+++ b/Tests/RunCMake/CMP0125/CMP0125-find_library-Common.cmake
@@ -1,17 +1,17 @@
-find_library(RELATIVE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(RELATIVE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(RELATIVE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(RELATIVE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
-find_library(ABSOLUTE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(ABSOLUTE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(ABSOLUTE_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(ABSOLUTE_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
-find_library(NOTFOUND_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(NOTFOUND_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(NOTFOUND_PATH NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(NOTFOUND_PATH_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
file(WRITE "${CMAKE_BINARY_DIR}/${FILE_NAME}" "")
file(CHMOD "${CMAKE_BINARY_DIR}/${FILE_NAME}" PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)
-find_library(FILE_NAME NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(FILE_NAME_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(FILE_NAME NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(FILE_NAME_WITH_TYPE NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
message("RELATIVE_PATH=${RELATIVE_PATH}")
message("RELATIVE_PATH_WITH_TYPE=${RELATIVE_PATH_WITH_TYPE}")
@@ -33,14 +33,14 @@ set(ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL /absolute_local)
set(NOTFOUND_AND_LOCAL "${FILE_NAME}")
set(NOTFOUND_WITH_TYPE_AND_LOCAL "${FILE_NAME}")
-find_library(RELATIVE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(RELATIVE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(RELATIVE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(RELATIVE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
-find_library(ABSOLUTE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(ABSOLUTE_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(ABSOLUTE_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
-find_library(NOTFOUND_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
-find_library(NOTFOUND_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH})
+find_library(NOTFOUND_PATH_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
+find_library(NOTFOUND_PATH_WITH_TYPE_AND_LOCAL NAMES ${SEARCH_NAME} PATHS ${SEARCH_PATH} NO_DEFAULT_PATH)
message("RELATIVE_PATH_AND_LOCAL=${RELATIVE_PATH_AND_LOCAL}")
message("RELATIVE_PATH_WITH_TYPE_AND_LOCAL=${RELATIVE_PATH_WITH_TYPE_AND_LOCAL}")