cmExportInstallFileGenerator: Report errors with IssueMessage

This commit is contained in:
Martin Duffy 2024-12-26 09:14:44 -05:00
parent 6195cefcfe
commit 7b553a3b1d
5 changed files with 21 additions and 6 deletions

View File

@ -25,6 +25,7 @@
#include "cmTarget.h"
#include "cmTargetExport.h"
#include "cmValue.h"
#include "cmake.h"
cmExportInstallFileGenerator::cmExportInstallFileGenerator(
cmInstallExportGenerator* iegen)
@ -327,7 +328,9 @@ void cmExportInstallFileGenerator::ComplainAboutDuplicateTarget(
void cmExportInstallFileGenerator::ReportError(
std::string const& errorMessage) const
{
cmSystemTools::Error(errorMessage);
this->IEGen->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
MessageType::FATAL_ERROR, errorMessage,
this->IEGen->GetLocalGenerator()->GetMakefile()->GetBacktrace());
}
std::string cmExportInstallFileGenerator::InstallNameDir(

View File

@ -1 +1,3 @@
CMake Error: install\(EXPORT "exp" ...\) includes target "UseA" which requires target "A" that is not in any export set.
CMake Error in CMakeLists.txt:
install\(EXPORT "exp" ...\) includes target "UseA" which requires target "A"
that is not in any export set.

View File

@ -1,2 +1,8 @@
CMake Error: Package "test" specifies DEFAULT_TARGETS "dog", which is not a target in the export set "foo".
CMake Error: Package "test" specifies DEFAULT_TARGETS "cat", which is not a target in the export set "foo".
CMake Error in CMakeLists.txt:
Package "test" specifies DEFAULT_TARGETS "dog", which is not a target in
the export set "foo".
CMake Error in CMakeLists.txt:
Package "test" specifies DEFAULT_TARGETS "cat", which is not a target in
the export set "foo".

View File

@ -1 +1,3 @@
CMake Error: install\(PACKAGE_INFO "dog" \.\.\.\) includes target "canine" which requires target "mammal" that is not in any export set.
CMake Error in CMakeLists.txt:
install\(PACKAGE_INFO "dog" \.\.\.\) includes target "canine" which requires
target "mammal" that is not in any export set.

View File

@ -1 +1,3 @@
CMake Error: install\(EXPORT "Exp" ...\) includes target "foo" which requires target "not_exported" that is not in any export set.
CMake Error in CMakeLists.txt:
install\(EXPORT "Exp" ...\) includes target "foo" which requires target
"not_exported" that is not in any export set.