summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx39
-rw-r--r--Source/cmInstallCommand.cxx42
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx35
-rw-r--r--Source/cmTarget.cxx3
-rw-r--r--Source/cmTimestamp.cxx1
7 files changed, 91 insertions, 34 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 1422451..8621bdf 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 7)
-set(CMake_VERSION_PATCH 20170128)
+set(CMake_VERSION_PATCH 20170131)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index dcf3764..6ce8140 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5308,7 +5308,8 @@ bool cmGeneratorTarget::IsLinkable() const
bool cmGeneratorTarget::IsFrameworkOnApple() const
{
- return (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
+ return ((this->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->GetType() == cmStateEnums::STATIC_LIBRARY) &&
this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("FRAMEWORK"));
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d448315..8627cf2 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1816,8 +1816,34 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
// Handle settings for each target type.
switch (gtgt->GetType()) {
- case cmStateEnums::OBJECT_LIBRARY:
- case cmStateEnums::STATIC_LIBRARY: {
+ case cmStateEnums::STATIC_LIBRARY:
+ if (gtgt->GetPropertyAsBool("FRAMEWORK")) {
+ std::string fw_version = gtgt->GetFrameworkVersion();
+ buildSettings->AddAttribute("FRAMEWORK_VERSION",
+ this->CreateString(fw_version));
+ const char* ext = gtgt->GetProperty("BUNDLE_EXTENSION");
+ if (ext) {
+ buildSettings->AddAttribute("WRAPPER_EXTENSION",
+ this->CreateString(ext));
+ }
+
+ std::string plist = this->ComputeInfoPListLocation(gtgt);
+ // Xcode will create the final version of Info.plist at build time,
+ // so let it replace the framework name. This avoids creating
+ // a per-configuration Info.plist file.
+ this->CurrentLocalGenerator->GenerateFrameworkInfoPList(
+ gtgt, "$(EXECUTABLE_NAME)", plist.c_str());
+ buildSettings->AddAttribute("INFOPLIST_FILE",
+ this->CreateString(plist));
+ buildSettings->AddAttribute("MACH_O_TYPE",
+ this->CreateString("staticlib"));
+ } else {
+ buildSettings->AddAttribute("LIBRARY_STYLE",
+ this->CreateString("STATIC"));
+ }
+ break;
+
+ case cmStateEnums::OBJECT_LIBRARY: {
buildSettings->AddAttribute("LIBRARY_STYLE",
this->CreateString("STATIC"));
break;
@@ -2336,8 +2362,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
switch (target->GetType()) {
case cmStateEnums::OBJECT_LIBRARY:
- case cmStateEnums::STATIC_LIBRARY:
return "archive.ar";
+ case cmStateEnums::STATIC_LIBRARY:
+ return (target->GetPropertyAsBool("FRAMEWORK") ? "wrapper.framework"
+ : "archive.ar");
case cmStateEnums::MODULE_LIBRARY:
if (target->IsXCTestOnApple())
return "wrapper.cfbundle";
@@ -2367,8 +2395,11 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
switch (target->GetType()) {
case cmStateEnums::OBJECT_LIBRARY:
- case cmStateEnums::STATIC_LIBRARY:
return "com.apple.product-type.library.static";
+ case cmStateEnums::STATIC_LIBRARY:
+ return (target->GetPropertyAsBool("FRAMEWORK")
+ ? "com.apple.product-type.framework"
+ : "com.apple.product-type.library.static");
case cmStateEnums::MODULE_LIBRARY:
if (target->IsXCTestOnApple())
return "com.apple.product-type.bundle.unit-test";
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index fadebb4..4c331c7 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -471,17 +471,39 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
} break;
case cmStateEnums::STATIC_LIBRARY: {
- // Static libraries use ARCHIVE properties.
- if (!archiveArgs.GetDestination().empty()) {
- archiveGenerator =
- CreateInstallTargetGenerator(target, archiveArgs, false);
+ // If it is marked with FRAMEWORK property use the FRAMEWORK set of
+ // INSTALL properties. Otherwise, use the LIBRARY properties.
+ if (target.IsFrameworkOnApple()) {
+ // When in namelink only mode skip frameworks.
+ if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ continue;
+ }
+
+ // Use the FRAMEWORK properties.
+ if (!frameworkArgs.GetDestination().empty()) {
+ frameworkGenerator =
+ CreateInstallTargetGenerator(target, frameworkArgs, false);
+ } else {
+ std::ostringstream e;
+ e << "TARGETS given no FRAMEWORK DESTINATION for static library "
+ "FRAMEWORK target \""
+ << target.GetName() << "\".";
+ this->SetError(e.str());
+ return false;
+ }
} else {
- std::ostringstream e;
- e << "TARGETS given no ARCHIVE DESTINATION for static library "
- "target \""
- << target.GetName() << "\".";
- this->SetError(e.str());
- return false;
+ // Static libraries use ARCHIVE properties.
+ if (!archiveArgs.GetDestination().empty()) {
+ archiveGenerator =
+ CreateInstallTargetGenerator(target, archiveArgs, false);
+ } else {
+ std::ostringstream e;
+ e << "TARGETS given no ARCHIVE DESTINATION for static library "
+ "target \""
+ << target.GetName() << "\".";
+ this->SetError(e.str());
+ return false;
+ }
}
} break;
case cmStateEnums::MODULE_LIBRARY: {
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 27b7c21..ff8b604 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -597,12 +597,26 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Clean files associated with this library.
std::vector<std::string> libCleanFiles;
libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath(
- this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath));
- if (targetNameReal != targetName) {
+ this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal));
+
+ std::vector<std::string> commands1;
+ // Add a command to remove any existing files for this library.
+ // for static libs only
+ if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
+ this->GeneratorTarget, "target");
+ this->LocalGenerator->CreateCDCommand(
+ commands1, this->Makefile->GetCurrentBinaryDirectory(),
+ this->LocalGenerator->GetBinaryDirectory());
+ commands.insert(commands.end(), commands1.begin(), commands1.end());
+ commands1.clear();
+ }
+
+ if (targetName != targetNameReal) {
libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath(
- this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal));
+ this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath));
}
- if (targetNameSO != targetName && targetNameSO != targetNameReal) {
+ if (targetNameSO != targetNameReal && targetNameSO != targetName) {
libCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath(
this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathSO));
}
@@ -634,19 +648,6 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
}
#endif
- std::vector<std::string> commands1;
- // Add a command to remove any existing files for this library.
- // for static libs only
- if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
- this->LocalGenerator->AppendCleanCommand(commands1, libCleanFiles,
- this->GeneratorTarget, "target");
- this->LocalGenerator->CreateCDCommand(
- commands1, this->Makefile->GetCurrentBinaryDirectory(),
- this->LocalGenerator->GetBinaryDirectory());
- commands.insert(commands.end(), commands1.begin(), commands1.end());
- commands1.clear();
- }
-
// Add the pre-build and pre-link rules building but not when relinking.
if (!relink) {
this->LocalGenerator->AppendCustomCommands(
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8c62c48..fe3472d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -451,7 +451,8 @@ bool cmTarget::HasImportLibrary() const
bool cmTarget::IsFrameworkOnApple() const
{
- return (this->GetType() == cmStateEnums::SHARED_LIBRARY &&
+ return ((this->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->GetType() == cmStateEnums::STATIC_LIBRARY) &&
this->Makefile->IsOn("APPLE") &&
this->GetPropertyAsBool("FRAMEWORK"));
}
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 1e5ac5b..3d42e26 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -136,6 +136,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
case 'w':
case 'y':
case 'Y':
+ case '%':
break;
case 's': // Seconds since UNIX epoch (midnight 1-jan-1970)
{