summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth R Johnson <johnsonsr@ornl.gov>2021-10-10 10:31:42 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-12 15:40:45 (GMT)
commitfc92d6640b09def31d129f3e347b98af1aa1e098 (patch)
tree9f25760e5e2f46acb42b2ddcba1e7375ef8795fd
parent7257539e67930985eef82aeab29cb32ef357aec7 (diff)
downloadCMake-fc92d6640b09def31d129f3e347b98af1aa1e098.zip
CMake-fc92d6640b09def31d129f3e347b98af1aa1e098.tar.gz
CMake-fc92d6640b09def31d129f3e347b98af1aa1e098.tar.bz2
cmFileCommand: improve error message
Print full list of unresolved dependencies and a phrase that indicates what about the file is unresolved.
-rw-r--r--Source/cmFileCommand.cxx9
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt4
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt4
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt4
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt4
5 files changed, 18 insertions, 7 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d2341c5..fd0595d 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3170,9 +3170,12 @@ bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args,
archive.GetUnresolvedPaths().begin(),
archive.GetUnresolvedPaths().end());
} else {
- auto it = archive.GetUnresolvedPaths().begin();
- assert(it != archive.GetUnresolvedPaths().end());
- status.SetError(cmStrCat("Could not resolve file ", *it));
+ std::ostringstream e;
+ e << "Could not resolve runtime dependencies:";
+ for (auto const& path : archive.GetUnresolvedPaths()) {
+ e << "\n " << path;
+ }
+ status.SetError(e.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt
index 5b86322..9ed1728 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt
@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Could not resolve file libtest\.so$
+ file Could not resolve runtime dependencies:
+
+ libtest\.so$
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt
index eaca512..51010a1 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt
@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Could not resolve file libunresolved\.so$
+ file Could not resolve runtime dependencies:
+
+ libunresolved\.so$
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt
index 01762b4..5743d27 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt
@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Could not resolve file @rpath/libunresolved\.dylib$
+ file Could not resolve runtime dependencies:
+
+ @rpath/libunresolved\.dylib$
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt
index a20654c..0efcb57 100644
--- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt
@@ -1,2 +1,4 @@
^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Could not resolve file (lib)?unresolved\.dll$
+ file Could not resolve runtime dependencies:
+
+ (lib)?unresolved\.dll$