diff options
author | Eugene Shalygin <eugene.shalygin@gmail.com> | 2021-07-20 18:08:17 (GMT) |
---|---|---|
committer | Eugene Shalygin <eugene.shalygin@gmail.com> | 2021-07-22 11:08:58 (GMT) |
commit | 55e4753bbb60c0da12b09837bac97a46b851ae32 (patch) | |
tree | 392f9c7e46d7b45c95c60f7ce7b5a92fa0831623 /Source | |
parent | 26a76cf46d5209aec03d941fee203d23172dde75 (diff) | |
download | CMake-55e4753bbb60c0da12b09837bac97a46b851ae32.zip CMake-55e4753bbb60c0da12b09837bac97a46b851ae32.tar.gz CMake-55e4753bbb60c0da12b09837bac97a46b851ae32.tar.bz2 |
Refactor cmTargetExport removing InterfaceIncludeDirecories
Because of this property in the cmTargetExport struct, exporting targets
is not uniform: top-level ones have to be dealt with via the
cmTargetExport objects, while all linked ones are cmGeneratorTarget
objects. Let's pass this additional includedirectories via a special
target property making handling exported targets uniform.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 12 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 | ||||
-rw-r--r-- | Source/cmTargetExport.h | 1 |
5 files changed, 20 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index c69d484..2c54077 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -378,7 +378,8 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( cmGeneratorExpression ge; std::string dirs = cmGeneratorExpression::Preprocess( - tei->InterfaceIncludeDirectories, preprocessRule, true); + cmJoin(target->Target->GetInstallIncludeDirectoriesEntries(), ";"), + preprocessRule, true); this->ReplaceInstallPrefix(dirs); std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs); std::string exportDirs = diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 79109b5..687741b 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -36,6 +36,7 @@ #include "cmMessageType.h" #include "cmPolicies.h" #include "cmProperty.h" +#include "cmRange.h" #include "cmRuntimeDependencyArchive.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" @@ -681,8 +682,8 @@ bool HandleTargetsMode(std::vector<std::string> const& args, te->LibraryGenerator = libraryGenerator.get(); te->RuntimeGenerator = runtimeGenerator.get(); te->ObjectsGenerator = objectGenerator.get(); - te->InterfaceIncludeDirectories = - cmJoin(includesArgs.GetIncludeDirs(), ";"); + target.AddInstallIncludeDirectories( + cmMakeRange(includesArgs.GetIncludeDirs())); te->NamelinkOnly = namelinkOnly; helper.Makefile->GetGlobalGenerator() ->GetExportSets()[exports] diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7622700..70e11a2 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -189,6 +189,7 @@ public: std::map<std::string, BTs<std::string>> LanguageStandardProperties; std::vector<std::string> IncludeDirectoriesEntries; std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces; + std::vector<std::string> InstallIncludeDirectoriesEntries; std::vector<std::string> CompileOptionsEntries; std::vector<cmListFileBacktrace> CompileOptionsBacktraces; std::vector<std::string> CompileFeaturesEntries; @@ -1075,6 +1076,17 @@ std::set<std::string> const& cmTarget::GetSystemIncludeDirectories() const return this->impl->SystemIncludeDirectories; } +void cmTarget::AddInstallIncludeDirectories(cmStringRange const& incs) +{ + std::copy(incs.begin(), incs.end(), + std::back_inserter(this->impl->InstallIncludeDirectoriesEntries)); +} + +cmStringRange cmTarget::GetInstallIncludeDirectoriesEntries() const +{ + return cmMakeRange(this->impl->InstallIncludeDirectoriesEntries); +} + cmStringRange cmTarget::GetIncludeDirectoriesEntries() const { return cmMakeRange(this->impl->IncludeDirectoriesEntries); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 30d9f5d..29130c7 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -237,6 +237,9 @@ public: void AddSystemIncludeDirectories(std::set<std::string> const& incs); std::set<std::string> const& GetSystemIncludeDirectories() const; + void AddInstallIncludeDirectories(cmStringRange const& incs); + cmStringRange GetInstallIncludeDirectoriesEntries() const; + BTs<std::string> const* GetLanguageStandardProperty( const std::string& propertyName) const; diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h index 1e38d84..19fc931 100644 --- a/Source/cmTargetExport.h +++ b/Source/cmTargetExport.h @@ -29,7 +29,6 @@ public: cmInstallTargetGenerator* FrameworkGenerator; cmInstallTargetGenerator* BundleGenerator; cmInstallFilesGenerator* HeaderGenerator; - std::string InterfaceIncludeDirectories; ///@} bool NamelinkOnly = false; |