[cmake-developers] Automatic -F addition for frameworks?

Stephen Kelly steveire at gmail.com
Wed Jul 10 10:46:46 EDT 2013


Hi,

I've been looking into a patch to add an include directory automatically 
when a framework is used. For example:

 target_link_libraries(sometarget LINK_PRIVATE ${FOO})

if ${FOO}/.. is a framework path, then add ${FOO}/.. to the 
INCLUDE_DIRECTORIES of sometarget (at generate time).

This means that if I use 

 target_link_libraries(sometarget 
   LINK_PUBLIC /path/to/prefix/lib/QtCore.framework/QtCore)

I can use #include <QtCore/QString> without using any addtional commands to 
add include directories. That is true transitively because I used 
LINK_PUBLIC in the above example. Each dependent target will add the 
framework path to its own INCLUDE_DIRECTORIES.

Of course, using Qt5Core for this example does not make sense because a 
more-useful IMPORTED target is provided for that. 

This idea came from 

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/7260/focus=7283

The question is whether this is a worthwhile feature for cmake?

Thanks,

Steve.





More information about the cmake-developers mailing list