diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 28879f1c5..6f940a6b4 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1509,7 +1509,16 @@ static const struct InstallPrefixNode : public cmGeneratorExpressionNode } installPrefixNode; //---------------------------------------------------------------------------- -template +class ArtifactNameTag; +class ArtifactLinkerTag; +class ArtifactSonameTag; + +class ArtifactPathTag; +class ArtifactDirTag; +class ArtifactNameTag; + +//---------------------------------------------------------------------------- +template struct TargetFilesystemArtifactResultCreator { static std::string Create(cmTarget* target, @@ -1519,7 +1528,7 @@ struct TargetFilesystemArtifactResultCreator //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultCreator +struct TargetFilesystemArtifactResultCreator { static std::string Create(cmTarget* target, cmGeneratorExpressionContext *context, @@ -1549,7 +1558,7 @@ struct TargetFilesystemArtifactResultCreator //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultCreator +struct TargetFilesystemArtifactResultCreator { static std::string Create(cmTarget* target, cmGeneratorExpressionContext *context, @@ -1570,7 +1579,7 @@ struct TargetFilesystemArtifactResultCreator //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultCreator +struct TargetFilesystemArtifactResultCreator { static std::string Create(cmTarget* target, cmGeneratorExpressionContext *context, @@ -1582,7 +1591,7 @@ struct TargetFilesystemArtifactResultCreator //---------------------------------------------------------------------------- -template +template struct TargetFilesystemArtifactResultGetter { static std::string Get(const std::string &result); @@ -1590,7 +1599,7 @@ struct TargetFilesystemArtifactResultGetter //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultGetter +struct TargetFilesystemArtifactResultGetter { static std::string Get(const std::string &result) { return cmSystemTools::GetFilenameName(result); } @@ -1598,7 +1607,7 @@ struct TargetFilesystemArtifactResultGetter //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultGetter +struct TargetFilesystemArtifactResultGetter { static std::string Get(const std::string &result) { return cmSystemTools::GetFilenamePath(result); } @@ -1606,14 +1615,14 @@ struct TargetFilesystemArtifactResultGetter //---------------------------------------------------------------------------- template<> -struct TargetFilesystemArtifactResultGetter +struct TargetFilesystemArtifactResultGetter { static std::string Get(const std::string &result) { return result; } }; //---------------------------------------------------------------------------- -template +template struct TargetFilesystemArtifact : public cmGeneratorExpressionNode { TargetFilesystemArtifact() {} @@ -1661,7 +1670,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode context->AllTargets.insert(target); std::string result = - TargetFilesystemArtifactResultCreator::Create( + TargetFilesystemArtifactResultCreator::Create( target, context, content); @@ -1670,29 +1679,32 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode return std::string(); } return - TargetFilesystemArtifactResultGetter::Get(result); + TargetFilesystemArtifactResultGetter::Get(result); } }; +//---------------------------------------------------------------------------- +template +struct TargetFilesystemArtifactNodeGroup +{ + TargetFilesystemArtifactNodeGroup() + { + } + + TargetFilesystemArtifact File; + TargetFilesystemArtifact FileName; + TargetFilesystemArtifact FileDir; +}; + //---------------------------------------------------------------------------- static const -TargetFilesystemArtifact targetFileNode; +TargetFilesystemArtifactNodeGroup targetNodeGroup; + static const -TargetFilesystemArtifact targetLinkerFileNode; +TargetFilesystemArtifactNodeGroup targetLinkerNodeGroup; + static const -TargetFilesystemArtifact targetSoNameFileNode; -static const -TargetFilesystemArtifact targetFileNameNode; -static const -TargetFilesystemArtifact targetLinkerFileNameNode; -static const -TargetFilesystemArtifact targetSoNameFileNameNode; -static const -TargetFilesystemArtifact targetFileDirNode; -static const -TargetFilesystemArtifact targetLinkerFileDirNode; -static const -TargetFilesystemArtifact targetSoNameFileDirNode; +TargetFilesystemArtifactNodeGroup targetSoNameNodeGroup; //---------------------------------------------------------------------------- static const @@ -1718,15 +1730,15 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier) nodeMap["COMPILE_FEATURES"] = &compileFeaturesNode; nodeMap["CONFIGURATION"] = &configurationNode; nodeMap["CONFIG"] = &configurationTestNode; - nodeMap["TARGET_FILE"] = &targetFileNode; - nodeMap["TARGET_LINKER_FILE"] = &targetLinkerFileNode; - nodeMap["TARGET_SONAME_FILE"] = &targetSoNameFileNode; - nodeMap["TARGET_FILE_NAME"] = &targetFileNameNode; - nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerFileNameNode; - nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameFileNameNode; - nodeMap["TARGET_FILE_DIR"] = &targetFileDirNode; - nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerFileDirNode; - nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameFileDirNode; + nodeMap["TARGET_FILE"] = &targetNodeGroup.File; + nodeMap["TARGET_LINKER_FILE"] = &targetLinkerNodeGroup.File; + nodeMap["TARGET_SONAME_FILE"] = &targetSoNameNodeGroup.File; + nodeMap["TARGET_FILE_NAME"] = &targetNodeGroup.FileName; + nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerNodeGroup.FileName; + nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameNodeGroup.FileName; + nodeMap["TARGET_FILE_DIR"] = &targetNodeGroup.FileDir; + nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerNodeGroup.FileDir; + nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameNodeGroup.FileDir; nodeMap["STREQUAL"] = &strEqualNode; nodeMap["EQUAL"] = &equalNode; nodeMap["LOWER_CASE"] = &lowerCaseNode;