diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2017-03-23 13:32:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-18 15:36:10 (GMT) |
commit | eec93bceec5411e4409b5e3ee5dc301fca6fcbfd (patch) | |
tree | 58758ce2d61173c52559f55c0979236cafa7f969 /Source/cmExportInstallFileGenerator.cxx | |
parent | 93c89bc75ceee599ba7c08b8fe1ac5104942054f (diff) | |
download | CMake-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/cmExportInstallFileGenerator.cxx')
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 3b76a87..16bd5e8 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -331,6 +331,8 @@ void cmExportInstallFileGenerator::GenerateImportTargetsConfig( properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->RuntimeGenerator, properties, importedLocations); + this->SetImportLocationProperty(config, suffix, te->ObjectsGenerator, + properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->FrameworkGenerator, properties, importedLocations); this->SetImportLocationProperty(config, suffix, te->BundleGenerator, @@ -397,6 +399,23 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( // Store the property. properties[prop] = value; importedLocations.insert(prop); + } else if (itgen->GetTarget()->GetType() == cmStateEnums::OBJECT_LIBRARY) { + // Construct the property name. + std::string prop = "IMPORTED_OBJECTS"; + prop += suffix; + + // Compute all the object files inside this target and setup + // IMPORTED_OBJECTS as a list of object files + std::vector<std::string> objects; + itgen->GetInstallObjectNames(config, objects); + for (std::vector<std::string>::iterator i = objects.begin(); + i != objects.end(); ++i) { + *i = value + *i; + } + + // Store the property. + properties[prop] = cmJoin(objects, ";"); + importedLocations.insert(prop); } else { // Construct the property name. std::string prop = "IMPORTED_LOCATION"; |