summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/find_file/FromPrefixPath.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/find_file/FromPrefixPath.cmake')
-rw-r--r--Tests/RunCMake/find_file/FromPrefixPath.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/FromPrefixPath.cmake b/Tests/RunCMake/find_file/FromPrefixPath.cmake
new file mode 100644
index 000000000..63c6a0791
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPrefixPath.cmake
@@ -0,0 +1,19 @@
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} "")
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_PREFIX_PATH )
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+set(ENV{PATH} "${ENV_PATH}")