summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package/FromPATHEnv.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/find_package/FromPATHEnv.cmake')
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/FromPATHEnv.cmake b/Tests/RunCMake/find_package/FromPATHEnv.cmake
new file mode 100644
index 0000000..ceb79b6
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPATHEnv.cmake
@@ -0,0 +1,33 @@
+set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_DEBUG_MODE ON)
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot")
+find_package(Resolved QUIET)
+set(CMAKE_FIND_DEBUG_MODE OFF)
+
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved NO_SYSTEM_ENVIRONMENT_PATH QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")