summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_file/PrefixInPATH.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/find_file/PrefixInPATH.cmake')
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/PrefixInPATH.cmake b/Tests/RunCMake/find_file/PrefixInPATH.cmake
new file mode 100644
index 0000000..1e33c08
--- /dev/null
+++ b/Tests/RunCMake/find_file/PrefixInPATH.cmake
@@ -0,0 +1,8 @@
+set(ENV_PATH "$ENV{PATH}")
+foreach(path "/does_not_exist" "" "/bin" "/sbin")
+ unset(PrefixInPATH_INCLUDE_DIR CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_INCLUDE_DIR NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_INCLUDE_DIR='${PrefixInPATH_INCLUDE_DIR}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")