mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-15 14:00:40 -05:00
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:
@@ -216,6 +216,9 @@ static bool checkInterfaceDirs(const std::string& prepro,
|
|||||||
if (genexPos == 0) {
|
if (genexPos == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (cmHasLiteralPrefix(li, "${_IMPORT_PREFIX}")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
MessageType messageType = MessageType::FATAL_ERROR;
|
MessageType messageType = MessageType::FATAL_ERROR;
|
||||||
std::ostringstream e;
|
std::ostringstream e;
|
||||||
if (genexPos != std::string::npos) {
|
if (genexPos != std::string::npos) {
|
||||||
@@ -237,9 +240,6 @@ static bool checkInterfaceDirs(const std::string& prepro,
|
|||||||
hadFatalError = true;
|
hadFatalError = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cmHasLiteralPrefix(li, "${_IMPORT_PREFIX}")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!cmSystemTools::FileIsFullPath(li)) {
|
if (!cmSystemTools::FileIsFullPath(li)) {
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
e << "Target \"" << target->GetName() << "\" " << prop <<
|
e << "Target \"" << target->GetName() << "\" " << prop <<
|
||||||
|
|||||||
@@ -313,6 +313,8 @@ install(FILES
|
|||||||
)
|
)
|
||||||
cmake_policy(POP)
|
cmake_policy(POP)
|
||||||
|
|
||||||
|
cmake_policy(PUSH)
|
||||||
|
cmake_policy(SET CMP0041 NEW)
|
||||||
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
|
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
|
||||||
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
||||||
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
|
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
@@ -329,9 +331,10 @@ install(FILES
|
|||||||
DESTINATION include/testSharedLibDepends
|
DESTINATION include/testSharedLibDepends
|
||||||
)
|
)
|
||||||
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
set_property(TARGET testSharedLibDepends APPEND PROPERTY
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibDepends>"
|
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<1:include>/testSharedLibDepends>"
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||||
)
|
)
|
||||||
|
cmake_policy(POP)
|
||||||
|
|
||||||
# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
|
# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
|
||||||
target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired)
|
target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired)
|
||||||
|
|||||||
Reference in New Issue
Block a user