[CMake] Cannot include third-party Framework headers directories as system directories in XCode for avoiding their warning

tetractius tetractius at gmail.com
Tue May 10 12:16:44 EDT 2016


Hi list,

I have an issue caused by a warning in the qt5 brew version in osx when
using Xcode generator

I can safely find the qt framework in the brew cellar:

set(CMAKE_PREFIX_PATH /usr/local/opt/qt5)
find_package(Qt5Widgets REQUIRED)

and with this I can easily add this framework to my project by using

target_link_libraries(myApp Qt5::Widgets)

and this, as per documentation will cause to add all the -I<headers
framework directories> when compiling the .o files for this target.

The problem is that QT has some warning in their headers at the version 5.6
and 5.5.2_1 (that is all the qt5 the versions available in brew)
and the -I<headers framework directory> it is not a system include
parameter.


So assuming that I cannot avoid to use the brew version and I cannot fix
the problems in the qt5 headers,

*How can I tell to cmake that these framework include directories are
system include directories and thus they need to be included with -isystem
in the xcode project?*

I tryed to manually pass the flag to the compiler but the
target_link_libraries function, when used with the framework, it will
always put their include directories in front of mine without the isystem
flag.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160510/046c936d/attachment.html>


More information about the CMake mailing list