[CMake] Using a header only library that links uses Objective-C headers

Henry Borchers henryborchers at gmail.com
Wed Nov 30 16:59:34 EST 2016


>
> You don't compile a header only library


That's what I thought but this is my first time dealing with header only
libraries. Thanks for clearing up that confusion.


What you need is compiling the sources using it as Objective C.
> Which is a matter of adding target_compile_options(<target> PRIVATE
> "-ObjC") on the target with the sources if I remember correctly.


Yup! That worked! Thanks.

Henry

On Wed, Nov 30, 2016 at 11:01 AM, Florent Castelli <
florent.castelli at gmail.com> wrote:

> You don't compile a header only library (unless you're talking about
> precompiled headers, which I think you don't).
>
> What you need is compiling the sources using it as Objective C.
> Which is a matter of adding target_compile_options(<target> PRIVATE
> "-ObjC") on the target with the sources if I remember correctly.
>
> /Florent
>
>
> On 30/11/2016 17:55, Henry Borchers wrote:
>
> First time poster so I hope I get the etiquette right. I'm a novice CMake
> user and I've never come across the type of issue before.
>
> I'm trying to figure out how to use this cross platform header only dialog
> library in my project.
> https://github.com/guillaumechereau/noc
>
> When using this on OSX, it links to "AppKit.h" which is an Objective-c
> header. How can I tell CMake that this header only library file needs to be
> compiled as Objective-C if I'm compiling on OSX?
>
> Thanks,
> Henry
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161130/ba8f72f3/attachment.html>


More information about the CMake mailing list