View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015953CMakeCMakepublic2016-02-04 03:142016-06-10 14:21
Reporterjbauer 
Assigned ToGregor Jasny 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSOS XOS Version10.11.3
Product VersionCMake 3.4.3 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0015953: CMake Does Not Use -isystem with GCC on OS X
DescriptionOn OS X with the GCC compiler, CMake does not pass the -isystem flag to build commands for libraries configured with SYSTEM. For example, if target 'cmake_test' has an include added as 'target_include_directories( cmake_test SYSTEM PRIVATE ${PNG_INCLUDE_DIRS} )', -isystem will not be added on OS X with GCC.
Steps To ReproduceUse the 'target_include_directories' command with the SYSTEM option on OS X with GCC.

A minimal project that reproduces this issue has been provided via:
https://github.com/digitalriptide/cmake_test [^]
TagsNo tags attached.
Attached Files

 Relationships
related to 0004462closedBrad King Do not use -isystem on Mac OS X 
related to 0010837closedGregor Jasny GCC flag -isystem not applied on OS X 

  Notes
(0040438)
Brad King (manager)
2016-02-04 08:24

This is due to a condition here:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Compiler/GNU.cmake;hb=v3.4.3#l55 [^]

 if(NOT APPLE)
   set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
 endif()

which is present because at one time gcc on Apple did not support the flag. The condition may need to be updated to check the version/vendor of gcc.
(0040442)
Gregor Jasny (developer)
2016-02-07 14:45

I pushed apple-isystem-gcc topic containing
https://cmake.org/gitweb?p=stage/cmake.git;a=commit;h=2cae5128fdc6316a7f0913cb89ec467b33b9715b [^]

This will be available with CMake 3.6. In the meatime you could work around by adding something like this to your root CMakeLists.txt:
if(APPLE)
  set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
  set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
endif()
(0040448)
Brad King (manager)
2016-02-09 10:11

Re 0015953:0040442: Thanks. The commit is now in 'master':

 Apple: Enable -isystem for GNU Compiler >= 4
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cae5128 [^]
(0041264)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-04 03:14 jbauer New Issue
2016-02-04 08:24 Brad King Note Added: 0040438
2016-02-04 08:41 Gregor Jasny Assigned To => Gregor Jasny
2016-02-04 08:41 Gregor Jasny Status new => assigned
2016-02-07 07:18 Gregor Jasny Relationship added related to 0004462
2016-02-07 07:47 Gregor Jasny Relationship added related to 0010837
2016-02-07 14:45 Gregor Jasny Note Added: 0040442
2016-02-09 10:11 Brad King Note Added: 0040448
2016-02-09 10:11 Brad King Status assigned => resolved
2016-02-09 10:11 Brad King Resolution open => fixed
2016-02-09 10:11 Brad King Fixed in Version => CMake 3.6
2016-02-09 10:11 Brad King Target Version => CMake 3.6
2016-06-10 14:21 Kitware Robot Note Added: 0041264
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team