[CMake] Any way to set the "productType" in a CMake-generated Xcode project?

Parag Chandra parag at ionicsecurity.com
Wed Feb 4 15:40:01 EST 2015


One of the guys I work with figured out the following:

set_property(TARGET ${TargetName} PROPERTY XCODE_ATTRIBUTE_WRAPPER_EXTENSION "xctest")

Which will indeed cause the generated project to have the correct productType. Things seem to be working now, but the info.plist file that is generated needs to be modified to more closely align with what Xcode spits out for a unit test project. We've been playing with the MACOSX_BUNDLE_INFO_PLIST property to specify a template:

set (MACOSX_BUNDLE_INFO_PLIST "/Users/blah/Desktop/MacOSXBundleInfo.plist.in")

However, renaming that plist.in file so that it no longer exists results in no errors from CMake, so it seems that our template is being completely ignored. Is this a bug?


Parag Chandra
Software Engineer, Mobile Team
Mobile: +1.919.824.1410

[https://www.ionicsecurity.com/IonicSigHz.png]<https://ionic.com>

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309











From: Parag Chandra <parag at ionicsecurity.com<mailto:parag at ionicsecurity.com>>
Date: Wednesday, February 4, 2015 at 1:55 PM
To: "cmake at cmake.org<mailto:cmake at cmake.org>" <cmake at cmake.org<mailto:cmake at cmake.org>>
Subject: [CMake] Any way to set the "productType" in a CMake-generated Xcode project?

Hi,

I'm trying to generate a unit-test project for iOS via CMake using the following commands:

add_library (${TargetName} MODULE ${SourceFiles} ${HeaderFiles})
set_property(TARGET ${TargetName} PROPERTY BUNDLE True)

I've been able to adjust all the required settings save the most important one, which is the "productType" entry inside the PBXNativeTarget section of the generated Xcode project. This needs to be "com.apple.product-type.bundle.unit-test", but CMake sets it to "com.apple.product-type.bundle".

Is there any way to alter this value?

Thanks,


Parag Chandra
Software Engineer, Mobile Team
Mobile: +1.919.824.1410

[https://www.ionicsecurity.com/IonicSigHz.png]<https://ionic.com>

Ionic Security Inc.
1170 Peachtree St. NE STE 400, Atlanta, GA 30309










-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150204/c72a2558/attachment-0001.html>


More information about the CMake mailing list