find_*: Add debug logging infrastructure

Enable debug messages a new `--find-debug` command-line option or via
the `CMAKE_FIND_DEBUG_MODE` variable.

This work was started by Chris Wilson, continued by Ray Donnelly, and
then refactored by Robert Maynard to collect information into a single
message per find query.

Co-Author: Ray Donnelly <mingw.android@gmail.com>
Co-Author: Chris Wilson <chris+github@qwirx.com>
This commit is contained in:
Robert Maynard
2019-10-04 17:18:26 -04:00
parent 3289322e4f
commit a7ea20649d
11 changed files with 193 additions and 43 deletions
+13 -2
View File
@@ -766,10 +766,21 @@ public:
std::string GetModulesFile(const std::string& name) const
{
bool system;
return this->GetModulesFile(name, system);
std::string debugBuffer;
return this->GetModulesFile(name, system, false, debugBuffer);
}
std::string GetModulesFile(const std::string& name, bool& system) const;
/**
* Return a location of a file in cmake or custom modules directory
*/
std::string GetModulesFile(const std::string& name, bool& system) const
{
std::string debugBuffer;
return this->GetModulesFile(name, system, false, debugBuffer);
}
std::string GetModulesFile(const std::string& name, bool& system, bool debug,
std::string& debugBuffer) const;
//! Set/Get a property of this directory
void SetProperty(const std::string& prop, const char* value);