install,export: Fix export of a genex following $<INSTALL_PREFIX>

The relative path check added by commit 5838aba1aa (Export: Report error
on relative include with genex., 2013-11-26, v3.0.0-rc1~285^2) was added
one condition too early.  If the value starts in `${_IMPORT_PREFIX}`
(which comes from `$<INSTALL_PREFIX>`) then it is an absolute path.

Fixes: #19791
This commit is contained in:
Brad King
2019-10-04 09:23:13 -04:00
parent 65020633e6
commit 3ded5b6da8
2 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -216,6 +216,9 @@ static bool checkInterfaceDirs(const std::string& prepro,
if (genexPos == 0) {
continue;
}
if (cmHasLiteralPrefix(li, "${_IMPORT_PREFIX}")) {
continue;
}
MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
if (genexPos != std::string::npos) {
@@ -237,9 +240,6 @@ static bool checkInterfaceDirs(const std::string& prepro,
hadFatalError = true;
}
}
if (cmHasLiteralPrefix(li, "${_IMPORT_PREFIX}")) {
continue;
}
if (!cmSystemTools::FileIsFullPath(li)) {
/* clang-format off */
e << "Target \"" << target->GetName() << "\" " << prop <<