summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2017-03-23 13:32:08 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-18 15:36:10 (GMT)
commiteec93bceec5411e4409b5e3ee5dc301fca6fcbfd (patch)
tree58758ce2d61173c52559f55c0979236cafa7f969 /Source/cmTarget.cxx
parent93c89bc75ceee599ba7c08b8fe1ac5104942054f (diff)
downloadCMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.zip
CMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.tar.gz
CMake-eec93bceec5411e4409b5e3ee5dc301fca6fcbfd.tar.bz2
Allow OBJECT libraries to be installed, exported, and imported
Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
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 d29a8bd..d6f2f0d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1354,11 +1354,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;
@@ -1368,7 +1366,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;
@@ -1451,18 +1449,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);
}