diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2016-12-03 22:46:15 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2016-12-03 23:13:08 (GMT) |
commit | 7ecac703cec8bde71f8d11c1a8fa34bfa077edee (patch) | |
tree | a065bc78168db60cb827dfbe487fa49ede356a20 | |
parent | c45b767a8c2120ba61b9fafa31d8db37a919d62a (diff) | |
download | CMake-7ecac703cec8bde71f8d11c1a8fa34bfa077edee.zip CMake-7ecac703cec8bde71f8d11c1a8fa34bfa077edee.tar.gz CMake-7ecac703cec8bde71f8d11c1a8fa34bfa077edee.tar.bz2 |
Xcode: Add target property to override productType
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/XCODE_PRODUCT_TYPE.rst | 6 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index e55524c..292a85b 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -294,6 +294,7 @@ Properties on Targets /prop_tgt/WIN32_EXECUTABLE /prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS /prop_tgt/XCODE_ATTRIBUTE_an-attribute + /prop_tgt/XCODE_PRODUCT_TYPE /prop_tgt/XCTEST .. _`Test Properties`: diff --git a/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst new file mode 100644 index 0000000..1fbf001 --- /dev/null +++ b/Help/prop_tgt/XCODE_PRODUCT_TYPE.rst @@ -0,0 +1,6 @@ +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. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 50197c9..82ca7a8 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2340,6 +2340,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: |