[CMake] target_include_directories(): SYSTEM option does not seem to work on recent versions of CMake, when targeting Xcode.

A D boitoletre at gmail.com
Thu Aug 6 04:41:05 EDT 2015


Hi,

  We are moving our codebase from native project file to CMake based
management. The process is going well, but we need the Boost dependency to
be configured as a system library (to avoid spamming the build log with
Boost related warnings).

It is our understanding that giving a SYSTEM argument to
target_include_directories function should do just that. Yet it does not
seem to work as expected. We created a minimal example that reproduces the
problem:

cmake_minimum_required(VERSION 3.0)

find_package(Boost 1.49 COMPONENTS)

project(system_dependencies)

add_executable(${PROJECT_NAME} main.cpp)

target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})


The compiler invocation issued by Xcode contains this Boost header search
path:
*-I/Users/.../SDK/boost/include*
It is not using "-isystem" flag, whereas it is available.

Did we misuse the command ? Or should we report this as a bug ?

Thank you for reading,


----

The environment:
CMake v3.3.0 (previously tested with v3.0.0 for the same results)
OS X 10.9.5
Xcode 5.1.1

There is a Stack overflow question opened for this problem:
http://stackoverflow.com/q/31722426/1027706
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150806/4f46f239/attachment.html>


More information about the CMake mailing list