diff options
author | MikoĊaj Siedlarek <msiedlarek@nctz.net> | 2014-05-05 10:39:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-05-07 13:04:48 (GMT) |
commit | 1bed75a590707c311de6feddafdfb32cbb9e4afb (patch) | |
tree | cedeced7528d4a7c8b878a052b713b38f1d03565 /Source | |
parent | 1aed32faaeff40dcde2fa7cb75c7c249e68485e3 (diff) | |
download | CMake-1bed75a590707c311de6feddafdfb32cbb9e4afb.zip CMake-1bed75a590707c311de6feddafdfb32cbb9e4afb.tar.gz CMake-1bed75a590707c311de6feddafdfb32cbb9e4afb.tar.bz2 |
OS X: Use -iframework for system framework directories
Just like -I flag has its -isystem counterpart which marks an include
directory as a system directory and prevents unwanted warnings, on Apple
systems there is -iframework -- a system directory replacement for -F.
Use this flag to implement include_directories(SYSTEM) for frameworks.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f375b5f..c4c6428 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1344,6 +1344,12 @@ std::string cmLocalGenerator::GetIncludeFlags( const char* fwSearchFlag = this->Makefile->GetDefinition(fwSearchFlagVar); + std::string sysFwSearchFlagVar = "CMAKE_"; + sysFwSearchFlagVar += lang; + sysFwSearchFlagVar += "_SYSTEM_FRAMEWORK_SEARCH_FLAG"; + const char* sysFwSearchFlag = + this->Makefile->GetDefinition(sysFwSearchFlagVar); + bool flagUsed = false; std::set<std::string> emitted; #ifdef __APPLE__ @@ -1360,9 +1366,17 @@ std::string cmLocalGenerator::GetIncludeFlags( frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str()); if(emitted.insert(frameworkDir).second) { - includeFlags - << fwSearchFlag << this->Convert(frameworkDir, - START_OUTPUT, shellFormat, true) + if (sysFwSearchFlag && target && + target->IsSystemIncludeDirectory(*i, config)) + { + includeFlags << sysFwSearchFlag; + } + else + { + includeFlags << fwSearchFlag; + } + includeFlags << this->Convert(frameworkDir, START_OUTPUT, + shellFormat, true) << " "; } continue; |