From 392137b6d7e53ee6e7187b530522f772137bcd6c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 18 Apr 2006 10:56:28 -0400 Subject: ENH: Added _OUTPUT_NAME target property to allow the output name to be set on a per-configuration basis. --- Source/cmSetTargetPropertiesCommand.h | 4 +++- Source/cmTarget.cxx | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 84bbf77..2cdc7de 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -69,7 +69,9 @@ public: "(for SHARED library targets). " "OUTPUT_NAME sets the real name of a target when it is built and " "can be used to help create two targets of the same name even though " - "CMake requires unique logical target names. " + "CMake requires unique logical target names. There is also a " + "_OUTPUT_NAME that can set the output name on a " + "per-configuration basis. " "_POSTFIX sets a postfix for the real name of the target " "when it is built under the configuration named by " "(in upper-case, such as \"DEBUG_POSTFIX\"). The value of " diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8290075..efa20f8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1199,9 +1199,20 @@ void cmTarget::GetFullNameInternal(TargetType type, outPrefix = targetPrefix?targetPrefix:""; // Append the target name or property-specified name. - if(const char* outname = this->GetProperty("OUTPUT_NAME")) + const char* outName = 0; + if(config && *config) + { + std::string configProp = cmSystemTools::UpperCase(config); + configProp += "_OUTPUT_NAME"; + outName = this->GetProperty(configProp.c_str()); + } + if(!outName) + { + outName = this->GetProperty("OUTPUT_NAME"); + } + if(outName) { - outBase = outname; + outBase = outName; } else { -- cgit v0.12