diff options
Diffstat (limited to 'Source/cmExportFileGenerator.h')
-rw-r--r-- | Source/cmExportFileGenerator.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h index 985c8f6bc..0d69779f9 100644 --- a/Source/cmExportFileGenerator.h +++ b/Source/cmExportFileGenerator.h @@ -5,16 +5,17 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmGeneratorExpression.h" -#include "cmVersion.h" -#include "cmVersionConfig.h" - #include <iosfwd> #include <map> #include <set> #include <string> #include <vector> +#include "cmGeneratorExpression.h" +#include "cmStateTypes.h" +#include "cmVersion.h" +#include "cmVersionConfig.h" + class cmGeneratorTarget; #define STRINGIFY_HELPER(X) #X @@ -41,7 +42,7 @@ class cmExportFileGenerator { public: cmExportFileGenerator(); - virtual ~cmExportFileGenerator() {} + virtual ~cmExportFileGenerator() = default; /** Set the full path to the export file to generate. */ void SetExportFile(const char* mainFile); @@ -61,7 +62,7 @@ public: bool GenerateImportFile(); protected: - typedef std::map<std::string, std::string> ImportPropertyMap; + using ImportPropertyMap = std::map<std::string, std::string>; // Generate per-configuration target information to the given output // stream. @@ -76,7 +77,8 @@ protected: virtual void GenerateImportFooterCode(std::ostream& os); void GenerateImportVersionCode(std::ostream& os); virtual void GenerateImportTargetCode(std::ostream& os, - cmGeneratorTarget const* target); + cmGeneratorTarget const* target, + cmStateEnums::TargetType targetType); virtual void GenerateImportPropertyCode(std::ostream& os, const std::string& config, cmGeneratorTarget const* target, @@ -100,13 +102,19 @@ protected: ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + enum class ImportLinkPropertyTargetNames + { + Yes, + No, + }; template <typename T> void SetImportLinkProperty(std::string const& suffix, cmGeneratorTarget* target, const std::string& propName, std::vector<T> const& entries, ImportPropertyMap& properties, - std::vector<std::string>& missingTargets); + std::vector<std::string>& missingTargets, + ImportLinkPropertyTargetNames targetNames); /** Each subclass knows how to generate its kind of export file. */ virtual bool GenerateMainFile(std::ostream& os) = 0; @@ -145,6 +153,14 @@ protected: cmTargetExport* target, cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + void PopulateLinkDirectoriesInterface( + cmTargetExport* target, + cmGeneratorExpression::PreprocessContext preprocessRule, + ImportPropertyMap& properties, std::vector<std::string>& missingTargets); + void PopulateLinkDependsInterface( + cmTargetExport* target, + cmGeneratorExpression::PreprocessContext preprocessRule, + ImportPropertyMap& properties, std::vector<std::string>& missingTargets); void SetImportLinkInterface( const std::string& config, std::string const& suffix, @@ -166,6 +182,10 @@ protected: virtual void GenerateRequiredCMakeVersion(std::ostream& os, const char* versionString); + bool PopulateExportProperties(cmGeneratorTarget* gte, + ImportPropertyMap& properties, + std::string& errorMessage); + // The namespace in which the exports are placed in the generated file. std::string Namespace; |