diff options
Diffstat (limited to 'Tests/RunCMake/find_library/PrefixInPATH.cmake')
-rw-r--r-- | Tests/RunCMake/find_library/PrefixInPATH.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_library/PrefixInPATH.cmake b/Tests/RunCMake/find_library/PrefixInPATH.cmake new file mode 100644 index 0000000..f1b8b18 --- /dev/null +++ b/Tests/RunCMake/find_library/PrefixInPATH.cmake @@ -0,0 +1,11 @@ +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) + +set(ENV_PATH "$ENV{PATH}") +foreach(path "/does_not_exist" "" "/bin" "/sbin") + unset(PrefixInPATH_LIBRARY CACHE) + set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}") + find_library(PrefixInPATH_LIBRARY NAMES PrefixInPATH) + message(STATUS "PrefixInPATH_LIBRARY='${PrefixInPATH_LIBRARY}'") +endforeach() +set(ENV{PATH} "${ENV_PATH}") |