Re: [CMake] target_include_directories(): SYSTEM option does not seem to work on recent versions of CMake, when targeting Xcode.
Opened issue 15687 for this problem: http://www.cmake.org/Bug/view.php?id=15687 Thank again for your help Nils. (ps: sorry, just realize now that I forgot to forward other answers to the list... Pasting the content below) 2015-08-07 9:27 GMT+02:00 A D boitole...@gmail.com: 2015-08-06 10:57 GMT+02:00 Nils Gladitz nilsglad...@gmail.com: suggesting that even though the compiler might support -isystem, Xcode itself does (or did) not. I can't tell if that is something that may or may not have changed with current Xcode releases. Xcode has been calling Clang behind the scene (I think it was a custom Apple GCC before). There is an Xcode setting for header search path, which is a list of 'non-system' headers. Even if there is not a separate Xcode settings for system headers, there is a setting for the cpp flags that are directly forwarded to the compiler: in practice, this allows to achieve everything that would be possible by invoking Clang directly. In particular, if I take the path from header search path setting, and put it as -isystem ${path_value} in the Other C++ flags setting, I obtain the expected result. If you have reason to believe it is supported now (e.g. because you are able to create and Xcode project without cmake that has explicit system includes) you may want to open an issue. Thank you for this suggestion, I will report the issue referring to this exchange. Best regards, 2015-08-07 9:55 GMT+02:00 A D boitole...@gmail.com: 2015-08-07 9:31 GMT+02:00 Nils Gladitz nilsglad...@gmail.com: One issue you might want to look for when passing the flag directly to the compiler without allowing IDE interpretation might be that the internal code model used by Xcode for e.g. auto-completion might then not know about it. That is a good point indeed. So I just tried, and both the linter and auto-completion seem to make no difference with regard to how the header path is provided to the project (they kept working in the same way): * The linter stopped 'underlining' the boost include as soon as I gave the '-isystem path' to the C++ flags * Adding a new library to this '-isystem' flag, auto-completion was aware of its symbols as soon as I included its headers in a compilation units. -- 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
Re: [CMake] target_include_directories(): SYSTEM option does not seem to work on recent versions of CMake, when targeting Xcode.
On 08/06/2015 10:41 AM, A D wrote: 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, I am not too familiar with XCode myself but Modules/Platform/Darwin.cmake contains # Xcode does not support -isystem yet. if(XCODE) set(CMAKE_INCLUDE_SYSTEM_FLAG_C) set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX) endif() suggesting that even though the compiler might support -isystem, Xcode itself does (or did) not. I can't tell if that is something that may or may not have changed with current Xcode releases. If you have reason to believe it is supported now (e.g. because you are able to create and Xcode project without cmake that has explicit system includes) you may want to open an issue. Nils -- 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
[CMake] target_include_directories(): SYSTEM option does not seem to work on recent versions of CMake, when targeting Xcode.
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 -- 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