summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-18 13:57:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-18 13:57:32 (GMT)
commit92b479fd1abb77dea5f257be539d92b57a862587 (patch)
treec68ded316ca3fafc934e5d14248956a294a816d2 /Source
parenta0c9104c8e60b4110b298bb8a0a1296adc274abb (diff)
parent058b8a0bfb722b3a75ca051c0e1f7b1261643815 (diff)
downloadCMake-92b479fd1abb77dea5f257be539d92b57a862587.zip
CMake-92b479fd1abb77dea5f257be539d92b57a862587.tar.gz
CMake-92b479fd1abb77dea5f257be539d92b57a862587.tar.bz2
Merge topic 'file-set-no-exist'
058b8a0bfb install(): Properly ignore FILE_SETs that don't exist Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7000
Diffstat (limited to 'Source')
-rw-r--r--Source/cmInstallCommand.cxx43
1 files changed, 22 insertions, 21 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index a77b26b..8ce7ed1 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -1077,29 +1077,30 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (!namelinkOnly) {
for (std::size_t i = 0; i < fileSetArgs.size(); i++) {
- auto* fileSet = target.GetFileSet(fileSetArgs[i].GetFileSet());
- auto interfaceFileSetEntries = cmExpandedList(target.GetSafeProperty(
- cmTarget::GetInterfaceFileSetsPropertyName(fileSet->GetType())));
- if (fileSet &&
- std::find(
- interfaceFileSetEntries.begin(), interfaceFileSetEntries.end(),
- fileSetArgs[i].GetFileSet()) != interfaceFileSetEntries.end()) {
- std::string destination;
- if (fileSet->GetType() == "HEADERS"_s) {
- destination = helper.GetIncludeDestination(&fileSetArgs[i]);
- } else {
- destination = fileSetArgs[i].GetDestination();
- if (destination.empty()) {
- status.SetError(
- cmStrCat("TARGETS given no FILE_SET DESTINATION for target \"",
- target.GetName(), "\" file set \"",
- fileSet->GetName(), "\"."));
- return false;
+ if (auto* fileSet = target.GetFileSet(fileSetArgs[i].GetFileSet())) {
+ auto interfaceFileSetEntries = cmExpandedList(target.GetSafeProperty(
+ cmTarget::GetInterfaceFileSetsPropertyName(fileSet->GetType())));
+ if (std::find(interfaceFileSetEntries.begin(),
+ interfaceFileSetEntries.end(),
+ fileSetArgs[i].GetFileSet()) !=
+ interfaceFileSetEntries.end()) {
+ std::string destination;
+ if (fileSet->GetType() == "HEADERS"_s) {
+ destination = helper.GetIncludeDestination(&fileSetArgs[i]);
+ } else {
+ destination = fileSetArgs[i].GetDestination();
+ if (destination.empty()) {
+ status.SetError(cmStrCat(
+ "TARGETS given no FILE_SET DESTINATION for target \"",
+ target.GetName(), "\" file set \"", fileSet->GetName(),
+ "\"."));
+ return false;
+ }
}
+ fileSetGenerators.push_back(CreateInstallFileSetGenerator(
+ helper, target, fileSet, destination, fileSetArgs[i]));
+ installsFileSet[i] = true;
}
- fileSetGenerators.push_back(CreateInstallFileSetGenerator(
- helper, target, fileSet, destination, fileSetArgs[i]));
- installsFileSet[i] = true;
}
}
}