diff options
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9efdb54..2a3ef9b 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -968,7 +968,34 @@ void cmake::SetArgs(const std::vector<std::string>& args) "--debug-find", CommandArgument::Values::Zero, [](std::string const&, cmake* state) -> bool { std::cout << "Running with debug output on for the `find` commands.\n"; - state->SetDebugFindOutputOn(true); + state->SetDebugFindOutput(true); + return true; + } }, + CommandArgument{ + "--debug-find-pkg", "Provide a package argument for --debug-find-pkg", + CommandArgument::Values::One, CommandArgument::RequiresSeparator::Yes, + [](std::string const& value, cmake* state) -> bool { + std::vector<std::string> find_pkgs(cmTokenize(value, ",")); + std::cout << "Running with debug output on for the 'find' commands " + "for package(s)"; + for (auto const& v : find_pkgs) { + std::cout << " " << v; + state->SetDebugFindOutputPkgs(v); + } + std::cout << ".\n"; + return true; + } }, + CommandArgument{ + "--debug-find-var", CommandArgument::Values::One, + CommandArgument::RequiresSeparator::Yes, + [](std::string const& value, cmake* state) -> bool { + std::vector<std::string> find_vars(cmTokenize(value, ",")); + std::cout << "Running with debug output on for the variable(s)"; + for (auto const& v : find_vars) { + std::cout << " " << v; + state->SetDebugFindOutputVars(v); + } + std::cout << ".\n"; return true; } }, CommandArgument{ "--trace-expand", CommandArgument::Values::Zero, @@ -1325,7 +1352,7 @@ void cmake::SetArgs(const std::vector<std::string>& args) this->DebugTryCompileOn(); } if (expandedPreset->DebugFind == true) { - this->SetDebugFindOutputOn(true); + this->SetDebugFindOutput(true); } } #endif @@ -3619,6 +3646,26 @@ void cmake::SetDeprecatedWarningsAsErrors(bool b) cmStateEnums::INTERNAL); } +void cmake::SetDebugFindOutputPkgs(std::string const& args) +{ + this->DebugFindPkgs.emplace(args); +} + +void cmake::SetDebugFindOutputVars(std::string const& args) +{ + this->DebugFindVars.emplace(args); +} + +bool cmake::GetDebugFindOutput(std::string const& var) const +{ + return this->DebugFindVars.count(var); +} + +bool cmake::GetDebugFindPkgOutput(std::string const& pkg) const +{ + return this->DebugFindPkgs.count(pkg); +} + #if !defined(CMAKE_BOOTSTRAP) cmMakefileProfilingData& cmake::GetProfilingOutput() { |