diff options
author | Brad King <brad.king@kitware.com> | 2022-02-10 19:42:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-10 21:30:04 (GMT) |
commit | 596e18540988a7c6a426c5997d0008444773fc02 (patch) | |
tree | 30887388b2949967b235d11ae7aa043a2a2747c8 /Tests/RunCMake/find_package | |
parent | 2f435275743a345b8bbfe7de60796a1423ce92fc (diff) | |
download | CMake-596e18540988a7c6a426c5997d0008444773fc02.zip CMake-596e18540988a7c6a426c5997d0008444773fc02.tar.gz CMake-596e18540988a7c6a426c5997d0008444773fc02.tar.bz2 |
find_package: Improve formatting of --debug-find output
Also spell out more complete content in the test's expect output.
Diffstat (limited to 'Tests/RunCMake/find_package')
4 files changed, 176 insertions, 41 deletions
diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt index b35f05e..55b6a7a 100644 --- a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt @@ -1,20 +1,83 @@ -CMake Debug Log at FromPATHEnv.cmake:5 \(find_package\): - find_package considered the following paths for Resolved.cmake.* -.*/Modules/FindResolved.cmake.* - The file was not found.* - <PackageName>_ROOT CMake variable.* - CMAKE_PREFIX_PATH variable.* - CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.* - Env variable Resolved_DIR.* - CMAKE_PREFIX_PATH env variable.* - Paths specified by the find_package HINTS option.* - Standard system environment variables.* -.*Tests/RunCMake/find_package/PackageRoot.* - CMake User Package Registry.* - CMake variables defined in the Platform file.* - CMake System Package Registry.* - Paths specified by the find_package PATHS option.* - find_package considered the following locations for the Config module:.* -.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake.* - The file was found at.* -.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake +^CMake Debug Log at FromPATHEnv.cmake:[0-9]+ \(find_package\): + find_package considered the following paths for Resolved.cmake + + [^ +]*/Modules/FindResolved.cmake + + The file was not found. + + <PackageName>_ROOT CMake variable \[CMAKE_FIND_USE_PACKAGE_ROOT_PATH\]. + + none + + CMAKE_PREFIX_PATH variable \[CMAKE_FIND_USE_CMAKE_PATH\]. + + none + + CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables + \[CMAKE_FIND_USE_CMAKE_PATH\]. + + none + + Env variable Resolved_DIR \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. + + none + + CMAKE_PREFIX_PATH env variable \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. +( + [^ +]+)+ + + CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables + \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. +( + [^ +]+)+ + + Paths specified by the find_package HINTS option. + + none + + Standard system environment variables + \[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\]. + + [^ +]*/Tests/RunCMake/find_package/PackageRoot + + CMake User Package Registry \[CMAKE_FIND_USE_PACKAGE_REGISTRY\]. +( + [^ +]+)+ + + CMake variables defined in the Platform file + \[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH\]. +( + [^ +]+)+ + + CMake System Package Registry + \[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\]. +( + [^ +]+)+ + + Paths specified by the find_package PATHS option. + + none + + find_package considered the following locations for the Config module: + + [^ +]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake + + The file was found at + + [^ +]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Debug Log at FromPATHEnv.cmake:[0-9]+ \(find_package\): +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/find_package/FromPATHEnv.cmake b/Tests/RunCMake/find_package/FromPATHEnv.cmake index ceb79b6..9158d4b 100644 --- a/Tests/RunCMake/find_package/FromPATHEnv.cmake +++ b/Tests/RunCMake/find_package/FromPATHEnv.cmake @@ -1,4 +1,7 @@ set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") + +set(ENV{CMAKE_PREFIX_PATH} "") set(CMAKE_FIND_DEBUG_MODE ON) set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot") @@ -30,4 +33,6 @@ foreach(path "/does_not_exist" "/PackageRoot" "") find_package(Resolved NO_SYSTEM_ENVIRONMENT_PATH QUIET) message(STATUS "Resolved_FOUND='${Resolved_FOUND}'") endforeach() + +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") set(ENV{PATH} "${ENV_PATH}") diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt index 94ed178..e3685bc 100644 --- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt +++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg-stderr.txt @@ -1,21 +1,83 @@ -CMake Debug Log at FromPATHEnvDebugPkg.cmake:4 \(find_package\): - find_package considered the following paths for Resolved.cmake.* -.*/Modules/FindResolved.cmake.* - The file was not found.* - <PackageName>_ROOT CMake variable.* - CMAKE_PREFIX_PATH variable.* - CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.* - Env variable Resolved_DIR.* - CMAKE_PREFIX_PATH env variable.* - CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables.* - Paths specified by the find_package HINTS option.* - Standard system environment variables.* -.*Tests/RunCMake/find_package/PackageRoot.* - CMake User Package Registry.* - CMake variables defined in the Platform file.* - CMake System Package Registry.* - Paths specified by the find_package PATHS option.* - find_package considered the following locations for the Config module:.* -.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake.* - The file was found at.* -.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake +^CMake Debug Log at FromPATHEnvDebugPkg.cmake:[0-9]+ \(find_package\): + find_package considered the following paths for Resolved.cmake + + [^ +]*/Modules/FindResolved.cmake + + The file was not found. + + <PackageName>_ROOT CMake variable \[CMAKE_FIND_USE_PACKAGE_ROOT_PATH\]. + + none + + CMAKE_PREFIX_PATH variable \[CMAKE_FIND_USE_CMAKE_PATH\]. + + none + + CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables + \[CMAKE_FIND_USE_CMAKE_PATH\]. + + none + + Env variable Resolved_DIR \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. + + none + + CMAKE_PREFIX_PATH env variable \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. +( + [^ +]+)+ + + CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables + \[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\]. +( + [^ +]+)+ + + Paths specified by the find_package HINTS option. + + none + + Standard system environment variables + \[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\]. + + [^ +]*/Tests/RunCMake/find_package/PackageRoot + + CMake User Package Registry \[CMAKE_FIND_USE_PACKAGE_REGISTRY\]. +( + [^ +]+)+ + + CMake variables defined in the Platform file + \[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH\]. +( + [^ +]+)+ + + CMake System Package Registry + \[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\]. +( + [^ +]+)+ + + Paths specified by the find_package PATHS option. + + none + + find_package considered the following locations for the Config module: + + [^ +]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake + + The file was found at + + [^ +]*/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) ++ +CMake Debug Log at FromPATHEnvDebugPkg.cmake:[0-9]+ \(find_package\): +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake index 0ed8a12..72b03e6 100644 --- a/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake +++ b/Tests/RunCMake/find_package/FromPATHEnvDebugPkg.cmake @@ -1,4 +1,7 @@ set(ENV_PATH "$ENV{PATH}") +set(ENV_CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}") + +set(ENV{CMAKE_PREFIX_PATH} "") set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot") find_package(Resolved QUIET) @@ -28,4 +31,6 @@ foreach(path "/does_not_exist" "/PackageRoot" "") find_package(ResolvedC NO_SYSTEM_ENVIRONMENT_PATH QUIET) message(STATUS "Resolved_FOUND='${ResolvedC_FOUND}'") endforeach() + +set(ENV{CMAKE_PREFIX_PATH} "${ENV_CMAKE_PREFIX_PATH}") set(ENV{PATH} "${ENV_PATH}") |