diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-05 11:13:49 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-07-24 15:32:58 (GMT) |
commit | 650e61f833c2cc3ace8405a22eb80a10cfc6187c (patch) | |
tree | 5cf31f8d89fab889dc622bf5f0f751dd0cb4db3e /Source/cmExportFileGenerator.cxx | |
parent | ff6de6d325fec9b4f257b27388be4a24fd8cadfe (diff) | |
download | CMake-650e61f833c2cc3ace8405a22eb80a10cfc6187c.zip CMake-650e61f833c2cc3ace8405a22eb80a10cfc6187c.tar.gz CMake-650e61f833c2cc3ace8405a22eb80a10cfc6187c.tar.bz2 |
Add a convenient way to add the includes install dir to the INTERFACE.
Export the INCLUDES DESTINATION without appending to the
INTERFACE_INCLUDE_DIRECTORIES of the target itself. That way, a target
can be exported multiple times with different INCLUDES DESTINATION
without unintended cross-pollution of export sets.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index b4e6e81..cff539f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -277,27 +277,31 @@ static bool checkInterfaceDirs(const std::string &prepro, //---------------------------------------------------------------------------- void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( - cmTarget *target, + cmTargetExport *tei, cmGeneratorExpression::PreprocessContext preprocessRule, ImportPropertyMap &properties, std::vector<std::string> &missingTargets) { + cmTarget *target = tei->Target; assert(preprocessRule == cmGeneratorExpression::InstallInterface); const char *propName = "INTERFACE_INCLUDE_DIRECTORIES"; const char *input = target->GetProperty(propName); - if (!input) + if (!input && tei->InterfaceIncludeDirectories.empty()) { return; } - if (!*input) + if (!*input && tei->InterfaceIncludeDirectories.empty()) { // Set to empty properties[propName] = ""; return; } - std::string prepro = cmGeneratorExpression::Preprocess(input, + std::string includes = (input?input:""); + const char* sep = input ? ";" : ""; + includes += sep + tei->InterfaceIncludeDirectories; + std::string prepro = cmGeneratorExpression::Preprocess(includes, preprocessRule); if (!prepro.empty()) { |