1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

cmFindPackage: fix over-reporting

Both track when a `_DIR` variable is already defined and suppress
implicit event reporting when a mode that has no reliable method for
such detection.
This commit is contained in:
Ben Boeckel
2025-05-20 20:42:20 +02:00
parent 8b3fc9578a
commit 0e53a67a7b
15 changed files with 1131 additions and 6 deletions

View File

@@ -614,15 +614,13 @@ void cmFindPackageCommand::InheritOptions(cmFindPackageCommand* other)
bool cmFindPackageCommand::IsFound() const
{
return !this->FileFound.empty();
return this->InitialState == FindState::Found;
}
bool cmFindPackageCommand::IsDefined() const
{
// A `find_package` always needs to be rerun because it could create
// variables, provide commands, or targets. Therefore it is never
// "predefined" whether it is found or not.
return false;
return this->InitialState == FindState::Found ||
this->InitialState == FindState::NotFound;
}
bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
@@ -933,6 +931,41 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
return false;
}
bool canBeIrrelevant = true;
if (this->UseConfigFiles || this->UseCpsFiles) {
canBeIrrelevant = false;
if (cmValue v = this->Makefile->GetState()->GetCacheEntryValue(
cmStrCat(this->Name, "_DIR"))) {
if (!v.IsNOTFOUND()) {
this->InitialState = FindState::Found;
} else {
this->InitialState = FindState::NotFound;
}
}
}
if (this->UseFindModules &&
(this->InitialState == FindState::Undefined ||
this->InitialState == FindState::NotFound)) {
// There are no definitive cache variables to know if a given `Find` module
// has been searched for or not. However, if we have a `_FOUND` variable,
// use that as an indication of a previous search.
if (cmValue v =
this->Makefile->GetDefinition(cmStrCat(this->Name, "_FOUND"))) {
if (v.IsOn()) {
this->InitialState = FindState::Found;
} else {
this->InitialState = FindState::NotFound;
}
}
}
// If there is no signaling variable and there's no reason to expect a cache
// variable, mark the initial state as "irrelevant".
if (this->InitialState == FindState::Undefined && canBeIrrelevant) {
this->InitialState = FindState::Irrelevant;
}
// Ignore EXACT with no version.
if (this->VersionComplete.empty() && this->VersionExact) {
this->VersionExact = false;
@@ -3477,6 +3510,19 @@ void cmFindPackageDebugState::FailedAtImpl(std::string const& path,
(void)regexName;
}
bool cmFindPackageDebugState::ShouldImplicitlyLogEvents() const
{
auto const* fpc = this->FindPackageCommand;
bool const canUsePackage = fpc->UseConfigFiles || fpc->UseCpsFiles;
return canUsePackage &&
fpc->FileFoundMode != cmFindPackageCommand::FoundPackageMode::Module &&
std::any_of(fpc->ConsideredPaths.begin(), fpc->ConsideredPaths.end(),
[](cmFindPackageCommand::ConsideredPath const& cp) {
return cp.Mode >
cmFindPackageCommand::FoundPackageMode::Module;
});
}
void cmFindPackageDebugState::WriteDebug() const
{
}
@@ -3677,7 +3723,7 @@ void cmFindPackageDebugState::WriteEvent(cmConfigureLog& log,
log.EndObject();
}
// TODO: Add provider information (see #26925)
if (fpc->IsFound()) {
if (!fpc->FileFound.empty()) {
log.BeginObject("found"_s);
log.WriteValue("path"_s, fpc->FileFound);
log.WriteValue("mode"_s, found_mode(fpc->FileFoundMode));

View File

@@ -184,6 +184,7 @@ private:
{
None,
Module,
// Do not implicitly log for prior package types.
Config,
Cps,
Provider,
@@ -365,6 +366,15 @@ private:
friend struct std::hash<ConfigFileInfo>;
friend class cmFindPackageDebugState;
enum class FindState
{
Undefined,
Irrelevant,
Found,
NotFound,
};
FindState InitialState = FindState::Undefined;
};
namespace std {
@@ -395,6 +405,7 @@ public:
private:
void FoundAtImpl(std::string const& path, std::string regexName) override;
void FailedAtImpl(std::string const& path, std::string regexName) override;
bool ShouldImplicitlyLogEvents() const override;
void WriteDebug() const override;
#ifndef CMAKE_BOOTSTRAP

View File

@@ -0,0 +1,236 @@
^
---
events:(
-
kind: "find-v1"(
[^
]*)+|
+ -
kind: "message-v1"
backtrace:(
- "[^"]+")+
message: \|(
+ [^
]*)*)*
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: |
NotDefined -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viaconfig-config|ViaConfigConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]+)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: |
NotFound -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> Found
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/cmake/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/cmake/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
found:
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/lib/cmake/ViaConfig/ViaConfigConfig.cmake"
mode: "config"
version: "1\.0"
search_context:(
[^
]*)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ViaConfigConfig.cmake"
mode: "none\?"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/viaconfig-config.cmake"
mode: "none\?"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viaconfig-config|ViaConfigConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]+)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
END
\.\.\.$

View File

@@ -0,0 +1,9 @@
-- NotDefined -> NotFound
-- Could NOT find ViaConfig \(missing: ViaConfig_DIR\)
-- NotFound -> NotFound
-- Could NOT find ViaConfig \(missing: ViaConfig_DIR\)
-- NotFound -> Found
-- Found -> Found
-- Found -> NotFound
-- Could NOT find ViaConfig \(missing: ViaConfig_DIR\)
-- END

View File

@@ -0,0 +1,43 @@
# Stable sorting for predictable behaviors.
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
# Unset search variables for more predictable output.
unset(CMAKE_FRAMEWORK_PATH)
unset(CMAKE_APPBUNDLE_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
unset(ENV{CMAKE_FRAMEWORK_PATH})
unset(ENV{CMAKE_APPBUNDLE_PATH})
message(STATUS "NotDefined -> NotFound")
message(CONFIGURE_LOG "NotDefined -> NotFound")
find_package(ViaConfig CONFIG)
message(STATUS "NotFound -> NotFound")
message(CONFIGURE_LOG "NotFound -> NotFound")
find_package(ViaConfig CONFIG)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog/cmake")
list(INSERT CMAKE_PREFIX_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog")
message(STATUS "NotFound -> Found")
message(CONFIGURE_LOG "NotFound -> Found")
find_package(ViaConfig CONFIG)
message(STATUS "Found -> Found")
message(CONFIGURE_LOG "Found -> Found")
find_package(ViaConfig CONFIG)
message(STATUS "Found -> NotFound")
message(CONFIGURE_LOG "Found -> NotFound")
list(REMOVE_AT CMAKE_PREFIX_PATH 0)
list(REMOVE_AT CMAKE_MODULE_PATH 0)
set_property(CACHE ViaConfig_DIR
PROPERTY
VALUE "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(ViaConfig CONFIG)
message(STATUS "END")
message(CONFIGURE_LOG "END")

View File

@@ -0,0 +1,236 @@
^
---
events:(
-
kind: "find-v1"(
[^
]*)+|
+ -
kind: "message-v1"
backtrace:(
- "[^"]+")+
message: \|(
+ [^
]*)*)*
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: |
NotDefined -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viaconfig-config|ViaConfigConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]+)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: |
NotFound -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> Found
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/cmake/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/cmake/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"
found:
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLog/lib/cmake/ViaConfig/ViaConfigConfig.cmake"
mode: "config"
version: "1\.0"
search_context:(
[^
]*)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaConfig"
configs:
-
filename: "ViaConfigConfig.cmake"
kind: "cmake"
-
filename: "viaconfig-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaConfig"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ViaConfigConfig.cmake"
mode: "none\?"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/viaconfig-config.cmake"
mode: "none\?"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/ViaConfigConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsConfig2-build/CMakeFiles/pkgRedirects/viaconfig-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viaconfig-config|ViaConfigConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]+)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
END
\.\.\.$

View File

@@ -0,0 +1,63 @@
^NotDefined -> NotFound
CMake Warning at ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaConfig.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaConfig", but CMake did not find one.
Could not find a package configuration file provided by "ViaConfig" with
any of the following names:
ViaConfigConfig.cmake
viaconfig-config.cmake
Add the installation prefix of "ViaConfig" to CMAKE_PREFIX_PATH or set
"ViaConfig_DIR" to a directory containing one of the above files. If
"ViaConfig" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
NotFound -> NotFound
CMake Warning at ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaConfig.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaConfig", but CMake did not find one.
Could not find a package configuration file provided by "ViaConfig" with
any of the following names:
ViaConfigConfig.cmake
viaconfig-config.cmake
Add the installation prefix of "ViaConfig" to CMAKE_PREFIX_PATH or set
"ViaConfig_DIR" to a directory containing one of the above files. If
"ViaConfig" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
NotFound -> Found
Found -> Found
Found -> NotFound
CMake Warning at ConfigureLogTransitionsConfig2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaConfig.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaConfig", but CMake did not find one.
Could not find a package configuration file provided by "ViaConfig" with
any of the following names:
ViaConfigConfig.cmake
viaconfig-config.cmake
Add the installation prefix of "ViaConfig" to CMAKE_PREFIX_PATH or set
"ViaConfig_DIR" to a directory containing one of the above files. If
"ViaConfig" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
END

View File

@@ -0,0 +1,43 @@
# Stable sorting for predictable behaviors.
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
# Unset search variables for more predictable output.
unset(CMAKE_FRAMEWORK_PATH)
unset(CMAKE_APPBUNDLE_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
unset(ENV{CMAKE_FRAMEWORK_PATH})
unset(ENV{CMAKE_APPBUNDLE_PATH})
message("NotDefined -> NotFound")
message(CONFIGURE_LOG "NotDefined -> NotFound")
find_package(ViaConfig)
message("NotFound -> NotFound")
message(CONFIGURE_LOG "NotFound -> NotFound")
find_package(ViaConfig)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog/cmake")
list(INSERT CMAKE_PREFIX_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog")
message("NotFound -> Found")
message(CONFIGURE_LOG "NotFound -> Found")
find_package(ViaConfig)
message("Found -> Found")
message(CONFIGURE_LOG "Found -> Found")
find_package(ViaConfig)
message("Found -> NotFound")
message(CONFIGURE_LOG "Found -> NotFound")
list(REMOVE_AT CMAKE_PREFIX_PATH 0)
list(REMOVE_AT CMAKE_MODULE_PATH 0)
set_property(CACHE ViaConfig_DIR
PROPERTY
VALUE "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(ViaConfig)
message("END")
message(CONFIGURE_LOG "END")

View File

@@ -0,0 +1,57 @@
^
---
events:(
-
kind: "find-v1"(
[^
]*)+|
+ -
kind: "message-v1"
backtrace:(
- "[^"]+")+
message: \|(
+ [^
]*)*)*
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotDefined -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
END
\.\.\.$

View File

@@ -0,0 +1,72 @@
^NotDefined -> NotFound
CMake Warning at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
No "FindViaModule.cmake" found in CMAKE_MODULE_PATH.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
CMake Warning \(dev\) at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
FindViaModule.cmake must either be part of this project itself, in this
case adjust CMAKE_MODULE_PATH so that it points to the correct location
inside its source tree.
Or it must be installed by a package which has already been found via
find_package\(\). In this case make sure that package has indeed been found
and adjust CMAKE_MODULE_PATH to contain the location where that package has
installed FindViaModule.cmake. This must be a location provided by that
package. This error in general means that the buildsystem of this project
is relying on a Find-module without ensuring that it is actually available.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
NotFound -> NotFound
CMake Warning at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
No "FindViaModule.cmake" found in CMAKE_MODULE_PATH.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
CMake Warning \(dev\) at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
FindViaModule.cmake must either be part of this project itself, in this
case adjust CMAKE_MODULE_PATH so that it points to the correct location
inside its source tree.
Or it must be installed by a package which has already been found via
find_package\(\). In this case make sure that package has indeed been found
and adjust CMAKE_MODULE_PATH to contain the location where that package has
installed FindViaModule.cmake. This must be a location provided by that
package. This error in general means that the buildsystem of this project
is relying on a Find-module without ensuring that it is actually available.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
NotFound -> Found
Found -> Found
Found -> NotFound
CMake Warning at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
No "FindViaModule.cmake" found in CMAKE_MODULE_PATH.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
CMake Warning \(dev\) at ConfigureLogTransitionsModule.cmake:[0-9]+ \(find_package\):
FindViaModule.cmake must either be part of this project itself, in this
case adjust CMAKE_MODULE_PATH so that it points to the correct location
inside its source tree.
Or it must be installed by a package which has already been found via
find_package\(\). In this case make sure that package has indeed been found
and adjust CMAKE_MODULE_PATH to contain the location where that package has
installed FindViaModule.cmake. This must be a location provided by that
package. This error in general means that the buildsystem of this project
is relying on a Find-module without ensuring that it is actually available.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
END$

View File

@@ -0,0 +1,41 @@
# Stable sorting for predictable behaviors.
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
# Unset search variables for more predictable output.
unset(CMAKE_FRAMEWORK_PATH)
unset(CMAKE_APPBUNDLE_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
unset(ENV{CMAKE_FRAMEWORK_PATH})
unset(ENV{CMAKE_APPBUNDLE_PATH})
message("NotDefined -> NotFound")
message(CONFIGURE_LOG "NotDefined -> NotFound")
find_package(ViaModule MODULE)
message("NotFound -> NotFound")
message(CONFIGURE_LOG "NotFound -> NotFound")
find_package(ViaModule MODULE)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog/cmake")
list(INSERT CMAKE_PREFIX_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog")
message("NotFound -> Found")
message(CONFIGURE_LOG "NotFound -> Found")
find_package(ViaModule MODULE)
message("Found -> Found")
message(CONFIGURE_LOG "Found -> Found")
find_package(ViaModule MODULE)
message("Found -> NotFound")
message(CONFIGURE_LOG "Found -> NotFound")
list(REMOVE_AT CMAKE_PREFIX_PATH 0)
list(REMOVE_AT CMAKE_MODULE_PATH 0)
unset(ViaModule_FOUND)
find_package(ViaModule MODULE)
message("END")
message(CONFIGURE_LOG "END")

View File

@@ -0,0 +1,161 @@
^
---
events:(
-
kind: "find-v1"(
[^
]*)+|
+ -
kind: "message-v1"
backtrace:(
- "[^"]+")+
message: \|(
+ [^
]*)*)*
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotDefined -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaModule"
configs:
-
filename: "ViaModuleConfig.cmake"
kind: "cmake"
-
filename: "viamodule-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaModule"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsModule2-build/CMakeFiles/pkgRedirects/ViaModuleConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsModule2-build/CMakeFiles/pkgRedirects/viamodule-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viamodule-config|ViaModuleConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]*)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> NotFound
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
NotFound -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> Found
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
Found -> NotFound
-
kind: "find_package-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(find_package\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
name: "ViaModule"
configs:
-
filename: "ViaModuleConfig.cmake"
kind: "cmake"
-
filename: "viamodule-config.cmake"
kind: "cmake"
version_request:
exact: false
settings:
required: "optional"
quiet: false
global: false
policy_scope: true
bypass_provider: false
names:
- "ViaModule"
path_suffixes:
- ""
paths:
CMAKE_FIND_USE_CMAKE_PATH: true
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
CMAKE_FIND_USE_INSTALL_PREFIX: true
CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
candidates:
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsModule2-build/CMakeFiles/pkgRedirects/ViaModuleConfig.cmake"
mode: "config"
reason: "no_exist"
-
path: "[^"]*/Tests/RunCMake/find_package/ConfigureLogTransitionsModule2-build/CMakeFiles/pkgRedirects/viamodule-config.cmake"
mode: "config"
reason: "no_exist"(
-
path: "[^"]*/(viamodule-config|ViaModuleConfig).cmake"
mode: "config"
reason: "no_exist")*
found: null
search_context:(
[^
]+)+
-
kind: "message-v1"
backtrace:
- "ConfigureLogTransitionsModule2.cmake:[0-9]+ \(message\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
message: \|
END
\.\.\.$

View File

@@ -0,0 +1,63 @@
^NotDefined -> NotFound
CMake Warning at ConfigureLogTransitionsModule2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaModule.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaModule", but CMake did not find one.
Could not find a package configuration file provided by "ViaModule" with
any of the following names:
ViaModuleConfig.cmake
viamodule-config.cmake
Add the installation prefix of "ViaModule" to CMAKE_PREFIX_PATH or set
"ViaModule_DIR" to a directory containing one of the above files. If
"ViaModule" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
NotFound -> NotFound
CMake Warning at ConfigureLogTransitionsModule2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaModule.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaModule", but CMake did not find one.
Could not find a package configuration file provided by "ViaModule" with
any of the following names:
ViaModuleConfig.cmake
viamodule-config.cmake
Add the installation prefix of "ViaModule" to CMAKE_PREFIX_PATH or set
"ViaModule_DIR" to a directory containing one of the above files. If
"ViaModule" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
NotFound -> Found
Found -> Found
Found -> NotFound
CMake Warning at ConfigureLogTransitionsModule2.cmake:[0-9]+ \(find_package\):
By not providing "FindViaModule.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"ViaModule", but CMake did not find one.
Could not find a package configuration file provided by "ViaModule" with
any of the following names:
ViaModuleConfig.cmake
viamodule-config.cmake
Add the installation prefix of "ViaModule" to CMAKE_PREFIX_PATH or set
"ViaModule_DIR" to a directory containing one of the above files. If
"ViaModule" provides a separate development package or SDK, be sure it has
been installed.
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
END$

View File

@@ -0,0 +1,40 @@
# Stable sorting for predictable behaviors.
set(CMAKE_FIND_PACKAGE_SORT_ORDER NAME)
# Unset search variables for more predictable output.
unset(CMAKE_FRAMEWORK_PATH)
unset(CMAKE_APPBUNDLE_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
unset(ENV{CMAKE_FRAMEWORK_PATH})
unset(ENV{CMAKE_APPBUNDLE_PATH})
message("NotDefined -> NotFound")
message(CONFIGURE_LOG "NotDefined -> NotFound")
find_package(ViaModule)
message("NotFound -> NotFound")
message(CONFIGURE_LOG "NotFound -> NotFound")
find_package(ViaModule)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog/cmake")
list(INSERT CMAKE_PREFIX_PATH 0
"${CMAKE_CURRENT_LIST_DIR}/ConfigureLog")
message("NotFound -> Found")
message(CONFIGURE_LOG "NotFound -> Found")
find_package(ViaModule)
message("Found -> Found")
message(CONFIGURE_LOG "Found -> Found")
find_package(ViaModule)
message("Found -> NotFound")
message(CONFIGURE_LOG "Found -> NotFound")
list(REMOVE_AT CMAKE_PREFIX_PATH 0)
list(REMOVE_AT CMAKE_MODULE_PATH 0)
find_package(ViaModule)
message("END")
message(CONFIGURE_LOG "END")

View File

@@ -8,6 +8,10 @@ run_cmake(ConfigureLog)
# Two tests because the stderr regex otherwise takes way too long to load.
run_cmake(ConfigureLogParameters1)
run_cmake(ConfigureLogParameters2)
run_cmake(ConfigureLogTransitionsConfig) # with `CONFIG`
run_cmake(ConfigureLogTransitionsConfig2) # without `CONFIG`, finding config
run_cmake(ConfigureLogTransitionsModule) # with `MODULE`
run_cmake(ConfigureLogTransitionsModule2) # without `MODULE`, finding module
run_cmake(EmptyRoots)
run_cmake(FromPATHEnv)
run_cmake_with_options(FromPATHEnvDebugPkg --debug-find-pkg=Resolved)