summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-11-26 09:34:44 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-26 12:01:29 (GMT)
commit9eedc850eb1419d678bda8137610dba1c289bb6a (patch)
treea34441e8838c489af082ed2b3c1ed6d9027fada9 /Source/cmExportFileGenerator.cxx
parent80790f33114cb6d80dfa0fd139cb2d92608cc68c (diff)
downloadCMake-9eedc850eb1419d678bda8137610dba1c289bb6a.zip
CMake-9eedc850eb1419d678bda8137610dba1c289bb6a.tar.gz
CMake-9eedc850eb1419d678bda8137610dba1c289bb6a.tar.bz2
Export: Process relative includes after genex evaluation.
In code such as install(TARGETS ... INCLUDES DESTINATION $<FOO>include ) the generator expressions are evaluated at generate-time. Delay determining whether each entry is a relative path until after the generator expressions are evaluated. Such relative paths are based relative to the CMAKE_INSTALL_PREFIX.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 2ce4458..8f83c02 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -286,6 +286,27 @@ static bool checkInterfaceDirs(const std::string &prepro,
}
//----------------------------------------------------------------------------
+static void prefixItems(std::string &exportDirs)
+{
+ std::vector<std::string> entries;
+ cmGeneratorExpression::Split(exportDirs, entries);
+ exportDirs = "";
+ const char *sep = "";
+ for(std::vector<std::string>::const_iterator ei = entries.begin();
+ ei != entries.end(); ++ei)
+ {
+ exportDirs += sep;
+ sep = ";";
+ if (!cmSystemTools::FileIsFullPath(ei->c_str())
+ && ei->find("${_IMPORT_PREFIX}") == std::string::npos)
+ {
+ exportDirs += "${_IMPORT_PREFIX}/";
+ }
+ exportDirs += *ei;
+ }
+}
+
+//----------------------------------------------------------------------------
void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
cmTargetExport *tei,
cmGeneratorExpression::PreprocessContext preprocessRule,
@@ -330,6 +351,8 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
return;
}
+ prefixItems(exportDirs);
+
std::string includes = (input?input:"");
const char* sep = input ? ";" : "";
includes += sep + exportDirs;