diff options
Diffstat (limited to 'Tests/RunCMake/find_file/FromPATHEnvDebugVar.cmake')
-rw-r--r-- | Tests/RunCMake/find_file/FromPATHEnvDebugVar.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_file/FromPATHEnvDebugVar.cmake b/Tests/RunCMake/find_file/FromPATHEnvDebugVar.cmake new file mode 100644 index 0000000..9f058dd --- /dev/null +++ b/Tests/RunCMake/find_file/FromPATHEnvDebugVar.cmake @@ -0,0 +1,24 @@ +set(ENV_PATH "$ENV{PATH}") +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{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 OFF) +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{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) +foreach(path "/does_not_exist" "/include" "") + unset(PrefixInPATH_File CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_file(PrefixInPATH_File NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH) + message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'") +endforeach() +set(ENV{PATH} "${ENV_PATH}") |