summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.h
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-10-04 17:18:26 -0400
committerRobert Maynard <robert.maynard@kitware.com>2019-12-19 08:09:49 -0500
commita7ea20649d4593bbad70b8a99aab4c2bf6294b79 (patch)
tree496c17d157b5c2f8e8c56b3ebc4bbefaa549d1bd /Source/cmFindCommon.h
parent3289322e4f05ef4f092d6ed0bc0b57d66c911c64 (diff)
downloadcmake-a7ea20649d4593bbad70b8a99aab4c2bf6294b79.tar.gz
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>
Diffstat (limited to 'Source/cmFindCommon.h')
-rw-r--r--Source/cmFindCommon.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 8177eacd6e..916f3bc9ba 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -30,8 +30,11 @@ public:
void SetError(std::string const& e);
+ bool DebugModeEnabled() const { return this->DebugMode; }
+
protected:
friend class cmSearchPath;
+ friend class cmFindBaseDebugState;
/** Used to define groups of path labels */
class PathGroup : public cmPathLabel
@@ -96,6 +99,10 @@ protected:
/** Compute the current default search modes based on global variables. */
void SelectDefaultSearchModes();
+ /** The `InitialPass` functions of the child classes should set
+ this->DebugMode to the result of this. */
+ bool ComputeIfDebugModeWanted();
+
// Path arguments prior to path manipulation routines
std::vector<std::string> UserHintsArgs;
std::vector<std::string> UserGuessArgs;
@@ -106,6 +113,8 @@ protected:
bool CheckCommonArgument(std::string const& arg);
void AddPathSuffix(std::string const& arg);
+ void DebugMessage(std::string const& msg) const;
+ bool DebugMode;
bool NoDefaultPath;
bool NoPackageRootPath;
bool NoCMakePath;