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

Florent Castelli florent.castelli at gmail.com
Wed Nov 30 12:01:39 EST 2016


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161130/4300a2ae/attachment.html>


More information about the CMake mailing list