summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-04 21:34:25 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-04 21:34:25 (GMT)
commit3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74 (patch)
tree6705b688a2fcfe98ffaa27afba37b77244cdbf01 /Source/cmTargetLinkLibrariesCommand.cxx
parentbf796f1434fd049ec77f7df5d4b8126b0d6ab96a (diff)
downloadCMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.zip
CMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.tar.gz
CMake-3c5cf1bb8c4e146f3d3d177f2be9dc53869f5d74.tar.bz2
ENH: Allow a custom list of debug configurations
Create a DEBUG_CONFIGURATIONS global property as a way for projects to specify which configuration names are considered to be 'debug' configurations.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx41
1 files changed, 26 insertions, 15 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 0bccd27..d84e144 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -188,28 +188,39 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
return;
}
+ // Get the list of configurations considered to be DEBUG.
+ std::vector<std::string> const& debugConfigs =
+ this->Makefile->GetCMakeInstance()->GetDebugConfigs();
+ std::string prop;
+
// Include this library in the link interface for the target.
- if(llt == cmTarget::DEBUG)
+ if(llt == cmTarget::DEBUG || llt == cmTarget::GENERAL)
{
- // Put in only the DEBUG configuration interface.
- this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES_DEBUG", lib);
+ // Put in the DEBUG configuration interfaces.
+ for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
+ i != debugConfigs.end(); ++i)
+ {
+ prop = "LINK_INTERFACE_LIBRARIES_";
+ prop += *i;
+ this->Target->AppendProperty(prop.c_str(), lib);
+ }
}
- else if(llt == cmTarget::OPTIMIZED)
+ if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL)
{
- // Put in only the non-DEBUG configuration interface.
+ // Put in the non-DEBUG configuration interfaces.
this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
- // Make sure the DEBUG configuration interface exists so that this
- // one will not be used as a fall-back.
- if(!this->Target->GetProperty("LINK_INTERFACE_LIBRARIES_DEBUG"))
+ // Make sure the DEBUG configuration interfaces exist so that the
+ // general one will not be used as a fall-back.
+ for(std::vector<std::string>::const_iterator i = debugConfigs.begin();
+ i != debugConfigs.end(); ++i)
{
- this->Target->SetProperty("LINK_INTERFACE_LIBRARIES_DEBUG", "");
+ prop = "LINK_INTERFACE_LIBRARIES_";
+ prop += *i;
+ if(!this->Target->GetProperty(prop.c_str()))
+ {
+ this->Target->SetProperty(prop.c_str(), "");
+ }
}
}
- else
- {
- // Put in both the DEBUG and non-DEBUG configuration interfaces.
- this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib);
- this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES_DEBUG", lib);
- }
}