summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-19 14:47:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-19 14:47:31 (GMT)
commit44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46 (patch)
treec95b4621b9a71adc962c9c2e3e3140a0fb73e627 /Source/cmTarget.cxx
parent9db9bb27ea3f3dd3db3913c2bc2233f03018d5b0 (diff)
parenteec93bceec5411e4409b5e3ee5dc301fca6fcbfd (diff)
downloadCMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.zip
CMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.tar.gz
CMake-44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46.tar.bz2
Merge topic 'objlib-extend'
eec93bce Allow OBJECT libraries to be installed, exported, and imported 93c89bc7 Genex: Allow TARGET_OBJECTS to be used everywhere ac0cf7ff Genex: Reject TARGET_OBJECTS on non-object libraries earlier 8577978c Tests: ExportImport C code should use explicit (void) in prototypes 26cfd039 cmInstallTargetGenerator: Re-order GenerateScriptForConfig logic 25f3f22a cmGlobalGenerator: Add method to check if object file location is known d596c550 cmGeneratorTarget: Add method to get the object file directory 930042f2 cmGeneratorTarget: Factor out a GetTargetObjectNames method ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !712
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx30
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f297988..0b1bb06 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1351,11 +1351,9 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config,
// Lookup/compute/cache the import information for this
// configuration.
- std::string config_upper;
- if (!config.empty()) {
- config_upper = cmSystemTools::UpperCase(config);
- } else {
- config_upper = "NOCONFIG";
+ std::string desired_config = config;
+ if (config.empty()) {
+ desired_config = "NOCONFIG";
}
std::string result;
@@ -1365,7 +1363,7 @@ std::string cmTarget::ImportedGetFullPath(const std::string& config,
std::string suffix;
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- this->GetMappedConfig(config_upper, &loc, &imp, suffix)) {
+ this->GetMappedConfig(desired_config, &loc, &imp, suffix)) {
if (!pimplib) {
if (loc) {
result = loc;
@@ -1448,18 +1446,28 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config,
const char** loc, const char** imp,
std::string& suffix) const
{
- std::string const locPropBase =
- this->GetType() == cmStateEnums::INTERFACE_LIBRARY ? "IMPORTED_LIBNAME"
- : "IMPORTED_LOCATION";
+ std::string config_upper;
+ if (!desired_config.empty()) {
+ config_upper = cmSystemTools::UpperCase(desired_config);
+ }
+
+ std::string locPropBase;
+ if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ locPropBase = "IMPORTED_LIBNAME";
+ } else if (this->GetType() == cmStateEnums::OBJECT_LIBRARY) {
+ locPropBase = "IMPORTED_OBJECTS";
+ } else {
+ locPropBase = "IMPORTED_LOCATION";
+ }
// Track the configuration-specific property suffix.
suffix = "_";
- suffix += desired_config;
+ suffix += config_upper;
std::vector<std::string> mappedConfigs;
{
std::string mapProp = "MAP_IMPORTED_CONFIG_";
- mapProp += desired_config;
+ mapProp += config_upper;
if (const char* mapValue = this->GetProperty(mapProp)) {
cmSystemTools::ExpandListArgument(mapValue, mappedConfigs, true);
}