[CMake] How do I set an Xcode property on the global/root project?

Eric Wing ewmailing at gmail.com
Sun Jun 14 16:21:36 EDT 2015


On 6/14/15, Gregor Jasny <gjasny at googlemail.com> wrote:
> Hi Eric,
>
> On 14/06/15 14:38, Eric Wing wrote:
>> I have been successful at setting Xcode properties on specific targets
>> with CMake via:
>>
>> set_property (TARGET ${TARGET} PROPERTY
>> XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE})
>>
>> But I have been unable to set properties on the global/root project.
>> Is there a way to do this?
>
> The excellent CMake documentation has the answer. The XCODE_ATTRIBUTE
> help page here:
> http://www.cmake.org/cmake/help/v3.2/prop_tgt/XCODE_ATTRIBUTE_an-attribute.html
>
> Would have pointed you to CMAKE_XCODE_ATTRIBUTE
>> http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_XCODE_ATTRIBUTE_an-attribute.html
>
> Hope that helps,
> Gregor
>

Can you elaborate on this? I can't make this work. (I remember that I
tried this before and failed.)

Here's an example of how I'm trying to invoke it:

set_property(GLOBAL PROPERTY
CMAKE_XCODE_ATTRIBUTE_SWIFT_OBJC_INTERFACE_HEADER_NAME
"BlurrrSwiftInterfaceHeader.h")

This seems to get ignored. (But if I use a per-target setting, then it works.)

Thanks,
Eric


More information about the CMake mailing list