summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-02 12:46:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-02 12:46:57 (GMT)
commit4b9227e718ed4244b44ee7e9d8c4a2d7bc9df653 (patch)
tree5b7c295282480ce4fd741ce0ab186c38e210b45a
parent66a7d2e222c3b8247f42b9eab02dbe42597a9d42 (diff)
parent3354d52e3d875e897e9bc8222c7d19ac484f23e8 (diff)
downloadCMake-4b9227e718ed4244b44ee7e9d8c4a2d7bc9df653.zip
CMake-4b9227e718ed4244b44ee7e9d8c4a2d7bc9df653.tar.gz
CMake-4b9227e718ed4244b44ee7e9d8c4a2d7bc9df653.tar.bz2
Merge topic 'find_file_frameworks_debug_output' into release-3.23
3354d52e3d find_file: Fix blank line instead of framework path in debug output Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7024
-rw-r--r--Source/cmFindPathCommand.cxx11
-rw-r--r--Source/cmFindPathCommand.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index a0a8570..27074ff 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -65,7 +65,8 @@ std::string cmFindPathCommand::FindHeader()
}
std::string cmFindPathCommand::FindHeaderInFramework(
- std::string const& file, std::string const& dir) const
+ std::string const& file, std::string const& dir,
+ cmFindBaseDebugState& debug) const
{
std::string fileName = file;
std::string frameWorkName;
@@ -88,11 +89,13 @@ std::string cmFindPathCommand::FindHeaderInFramework(
std::string fpath = cmStrCat(dir, frameWorkName, ".framework");
std::string intPath = cmStrCat(fpath, "/Headers/", fileName);
if (cmSystemTools::FileExists(intPath)) {
+ debug.FoundAt(intPath);
if (this->IncludeFileInPath) {
return intPath;
}
return fpath;
}
+ debug.FailedAt(intPath);
}
}
// if it is not found yet or not a framework header, then do a glob search
@@ -103,12 +106,15 @@ std::string cmFindPathCommand::FindHeaderInFramework(
std::vector<std::string> files = globIt.GetFiles();
if (!files.empty()) {
std::string fheader = cmSystemTools::CollapseFullPath(files[0]);
+ debug.FoundAt(fheader);
if (this->IncludeFileInPath) {
return fheader;
}
fheader.resize(fheader.size() - file.size());
return fheader;
}
+
+ // No frameworks matched the glob, so nothing more to add to debug.FailedAt()
return "";
}
@@ -135,8 +141,7 @@ std::string cmFindPathCommand::FindFrameworkHeader(cmFindBaseDebugState& debug)
{
for (std::string const& n : this->Names) {
for (std::string const& sp : this->SearchPaths) {
- std::string fwPath = this->FindHeaderInFramework(n, sp);
- fwPath.empty() ? debug.FailedAt(fwPath) : debug.FoundAt(fwPath);
+ std::string fwPath = this->FindHeaderInFramework(n, sp, debug);
if (!fwPath.empty()) {
return fwPath;
}
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index c7281f1..a7746f6 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -30,7 +30,8 @@ public:
private:
std::string FindHeaderInFramework(std::string const& file,
- std::string const& dir) const;
+ std::string const& dir,
+ cmFindBaseDebugState& debug) const;
std::string FindHeader();
std::string FindNormalHeader(cmFindBaseDebugState& debug);
std::string FindFrameworkHeader(cmFindBaseDebugState& debug);