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

Petr Kmoch petr.kmoch at gmail.com
Mon Jun 15 05:43:12 EDT 2015


On Sun, Jun 14, 2015 at 10:21 PM, Eric Wing <ewmailing at gmail.com> wrote:

> 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.)
>

The global setting is a variable, not a property. So you'd set it like this:

set(CMAKE_XCODE_ATTRIBUTE_SWIFT_OBJC_INTERFACE_HEADER_NAME
"BlurrrSwiftInterfaceHeader.h")

Hope it helps.

Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150615/4ad229e4/attachment.html>


More information about the CMake mailing list