diff options
author | Marc Chevrier <marc.chevrier@sap.com> | 2017-12-21 16:03:18 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@sap.com> | 2018-01-24 14:10:10 (GMT) |
commit | 044831117955dfa33ed4e0c7799ea3f37258b149 (patch) | |
tree | a443e5f1695bc9290ac7a8c27e4d0df019146a8d /Source/cmMakefileTargetGenerator.cxx | |
parent | 3073bd1f3deecaaf090202075382e372a3b3656a (diff) | |
download | CMake-044831117955dfa33ed4e0c7799ea3f37258b149.zip CMake-044831117955dfa33ed4e0c7799ea3f37258b149.tar.gz CMake-044831117955dfa33ed4e0c7799ea3f37258b149.tar.bz2 |
sourceFile properties: add property INCLUDE_DIRECTORIES
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index bee0168..1543536 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -455,10 +455,25 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( << "\n"; } + // Add include directories from source file properties. + std::vector<std::string> includes; + + const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES"); + if (const char* cincludes = source.GetProperty(INCLUDE_DIRECTORIES)) { + const char* evaluatedIncludes = + genexInterpreter.Evaluate(cincludes, INCLUDE_DIRECTORIES); + this->LocalGenerator->AppendIncludeDirectories(includes, evaluatedIncludes, + source); + *this->FlagFileStream << "# Custom include directories: " << relativeObj + << "_INCLUDE_DIRECTORIES = " << evaluatedIncludes + << "\n" + << "\n"; + } + // Add language-specific defines. std::set<std::string> defines; - // Add source-sepcific preprocessor definitions. + // Add source-specific preprocessor definitions. const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); if (const char* compile_defs = source.GetProperty(COMPILE_DEFINITIONS)) { const char* evaluatedDefs = @@ -575,7 +590,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( vars.Defines = definesString.c_str(); - std::string const includesString = "$(" + lang + "_INCLUDES)"; + std::string includesString = this->LocalGenerator->GetIncludeFlags( + includes, this->GeneratorTarget, lang, true, false, config); + this->LocalGenerator->AppendFlags(includesString, + "$(" + lang + "_INCLUDES)"); vars.Includes = includesString.c_str(); // At the moment, it is assumed that C, C++, Fortran, and CUDA have both |