diff options
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeCommands/target_link_libraries/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/CMakeCommands/target_link_libraries/empty.cpp | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 7ea58fa..3f59129 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -393,7 +393,7 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string &input) cmsys::RegularExpression targetNameValidator; // The ':' is supported to allow use with IMPORTED targets. At least // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter. - targetNameValidator.compile("^[A-Za-z0-9_.:-]+$"); + targetNameValidator.compile("^[A-Za-z0-9_.:+-]+$"); return targetNameValidator.find(input.c_str()); } diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt index b13c13d..3881644 100644 --- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt +++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt @@ -102,7 +102,14 @@ target_compile_definitions(depG INTERFACE TEST_DEF ) + add_executable(targetC targetC.cpp) +if(NOT BORLAND AND NOT WATCOM) + # Linking to a target containing a + should be non-fatal, though it does + # not work at all on Borland or watcom + add_library(wrapc++ empty.cpp) + target_link_libraries(targetC wrapc++) +endif() # The TARGET_PROPERTY expression is duplicated below to test that there is no # shortcutting of the evaluation by returning an empty string. set(_exe_test $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>) diff --git a/Tests/CMakeCommands/target_link_libraries/empty.cpp b/Tests/CMakeCommands/target_link_libraries/empty.cpp new file mode 100644 index 0000000..ab32cf6 --- /dev/null +++ b/Tests/CMakeCommands/target_link_libraries/empty.cpp @@ -0,0 +1 @@ +// No content |