Browse Source

Tests: Isolate RunCMake.FindPkgConfig from caller environment

Avoid interference from `CMAKE_PREFIX_PATH` and friends if they
happen to be set in the environment from which the tests are run.
Brad King 5 years ago
parent
commit
20eeb40aaf
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake

+ 5 - 0
Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake

@@ -1,5 +1,10 @@
 include(RunCMake)
 
+# Isolate test cases from caller's environment.
+set(ENV{CMAKE_PREFIX_PATH} "")
+set(ENV{CMAKE_APPBUNDLE_PATH} "")
+set(ENV{CMAKE_FRAMEWORK_PATH} "")
+
 run_cmake(PkgConfigDoesNotExist)
 
 run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH)