diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index f34a35b9ca..2e66d7822c 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -245,7 +245,7 @@ static void prefixItems(const std::string &content, std::string &result, result += sep; sep = ";"; if (!cmSystemTools::FileIsFullPath(ei->c_str()) - && cmGeneratorExpression::Find(*ei) == std::string::npos) + && cmGeneratorExpression::Find(*ei) != 0) { result += prefix; } diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 89c767ff5a..0e2828eb86 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -327,6 +327,8 @@ target_include_directories(testLibRequired INTERFACE $> $installIncludesTest6> $ + $> + $> ) install(TARGETS testLibIncludeRequired1 @@ -360,6 +362,8 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest6/installIncludesTest6.h" "// No content\n") file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" "// No content\n") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" "// No content\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest/installIncludesTest.h" DESTINATION installIncludesTest @@ -388,6 +392,10 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest7/installIncludesTest7.h" DESTINATION installIncludesTest7 ) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/installIncludesTest8/installIncludesTest8.h" + DESTINATION installIncludesTest8 +) install(TARGETS testLibDepends testSharedLibDepends EXPORT DependsExp DESTINATION lib ) install(EXPORT DependsExp FILE testLibDependsTargets.cmake DESTINATION lib/cmake/testLibDepends) diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c index 0dc8be23cc..953d0ad85d 100644 --- a/Tests/ExportImport/Import/A/deps_iface.c +++ b/Tests/ExportImport/Import/A/deps_iface.c @@ -11,6 +11,7 @@ #include "installIncludesTest5.h" #include "installIncludesTest6.h" #include "installIncludesTest7.h" +#include "installIncludesTest8.h" #ifndef testLibRequired_IFACE_DEFINE #error Expected testLibRequired_IFACE_DEFINE