summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-properties.7.rst2
-rw-r--r--Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst8
-rw-r--r--Help/prop_tgt/XCODE_PRODUCT_TYPE.rst8
-rw-r--r--Help/release/dev/xcode-message-extension.rst7
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx8
-rw-r--r--Source/cmMakefileTargetGenerator.cxx15
-rw-r--r--Source/cmNinjaTargetGenerator.cxx1
-rw-r--r--Source/cmRulePlaceholderExpander.h1
9 files changed, 49 insertions, 3 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index e55524c..70bd279 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -294,6 +294,8 @@ Properties on Targets
/prop_tgt/WIN32_EXECUTABLE
/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS
/prop_tgt/XCODE_ATTRIBUTE_an-attribute
+ /prop_tgt/XCODE_EXPLICIT_FILE_TYPE
+ /prop_tgt/XCODE_PRODUCT_TYPE
/prop_tgt/XCTEST
.. _`Test Properties`:
diff --git a/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst
new file mode 100644
index 0000000..dc92902
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EXPLICIT_FILE_TYPE.rst
@@ -0,0 +1,8 @@
+XCODE_EXPLICIT_FILE_TYPE
+------------------------
+
+Set the Xcode ``explicitFileType`` attribute on its reference to a
+target. CMake computes a default based on target type but
+can be told explicitly with this property.
+
+See also :prop_tgt:`XCODE_PRODUCT_TYPE`.
diff --git a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst
new file mode 100644
index 0000000..f4ef5c0
--- /dev/null
+++ b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst
@@ -0,0 +1,8 @@
+XCODE_PRODUCT_TYPE
+------------------
+
+Set the Xcode ``productType`` attribute on its reference to a
+target. CMake computes a default based on target type but
+can be told explicitly with this property.
+
+See also :prop_tgt:`XCODE_EXPLICIT_FILE_TYPE`.
diff --git a/Help/release/dev/xcode-message-extension.rst b/Help/release/dev/xcode-message-extension.rst
new file mode 100644
index 0000000..11c0702
--- /dev/null
+++ b/Help/release/dev/xcode-message-extension.rst
@@ -0,0 +1,7 @@
+xcode-message-extension
+-----------------------
+
+* New :prop_tgt:`XCODE_PRODUCT_TYPE` and :prop_tgt:`XCODE_EXPLICIT_FILE_TYPE`
+ target properties were created to tell the :generator:`Xcode` generator
+ to use custom values of the corresponding attributes for a target in the
+ generated Xcode project.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c837243..d484bee 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 20161210)
+set(CMake_VERSION_PATCH 20161212)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 50197c9..736aa91 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2313,6 +2313,10 @@ const char* cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(
const char* cmGlobalXCodeGenerator::GetTargetFileType(
cmGeneratorTarget* target)
{
+ if (const char* e = target->GetProperty("XCODE_EXPLICIT_FILE_TYPE")) {
+ return e;
+ }
+
switch (target->GetType()) {
case cmStateEnums::OBJECT_LIBRARY:
case cmStateEnums::STATIC_LIBRARY:
@@ -2340,6 +2344,10 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
const char* cmGlobalXCodeGenerator::GetTargetProductType(
cmGeneratorTarget* target)
{
+ if (const char* e = target->GetProperty("XCODE_PRODUCT_TYPE")) {
+ return e;
+ }
+
switch (target->GetType()) {
case cmStateEnums::OBJECT_LIBRARY:
case cmStateEnums::STATIC_LIBRARY:
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 6906a90..4218930 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -553,7 +553,6 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
}
}
cmRulePlaceholderExpander::RuleVariables vars;
- vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
vars.CMTargetName = this->GeneratorTarget->GetName().c_str();
vars.CMTargetType =
cmState::GetTargetTypeName(this->GeneratorTarget->GetType());
@@ -624,6 +623,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
lang_can_export_cmds && compileCommands.size() == 1) {
std::string compileCommand = compileCommands[0];
+ // no launcher for CMAKE_EXPORT_COMPILE_COMMANDS
rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
compileCommand, vars);
std::string workingDirectory = cmSystemTools::CollapseFullPath(
@@ -681,9 +681,20 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
}
}
+ std::string launcher;
+ {
+ const char* val = this->LocalGenerator->GetRuleLauncher(
+ this->GeneratorTarget, "RULE_LAUNCH_COMPILE");
+ if (val && *val) {
+ launcher = val;
+ launcher += " ";
+ }
+ }
+
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = compileCommands.begin();
i != compileCommands.end(); ++i) {
+ *i = launcher + *i;
rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, *i,
vars);
}
@@ -748,6 +759,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = preprocessCommands.begin();
i != preprocessCommands.end(); ++i) {
+ // no launcher for preprocessor commands
rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
*i, vars);
}
@@ -796,6 +808,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// Expand placeholders in the commands.
for (std::vector<std::string>::iterator i = assemblyCommands.begin();
i != assemblyCommands.end(); ++i) {
+ // no launcher for assembly commands
rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
*i, vars);
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 04a46af..6fc506d 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -1046,6 +1046,7 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
for (std::vector<std::string>::iterator i = compileCmds.begin();
i != compileCmds.end(); ++i) {
+ // no launcher for CMAKE_EXPORT_COMPILE_COMMANDS
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), *i,
compileObjectVars);
}
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index 5223ae9..8329166 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -56,7 +56,6 @@ public:
const char* LanguageCompileFlags;
const char* Defines;
const char* Includes;
- const char* RuleLauncher;
const char* DependencyFile;
const char* FilterPrefix;
};