Tests: CMakeCommands.target_link_directories test may not correct
When I build cmake on my system, it always report a error message like this
CMake Error at CMakeLists.txt:32 (message):
target_link_directories not populated the LINK_DIRECTORIES with relative
path
Configuring
CMake Error at CMakeLists.txt:39 (message):
target_link_directories not populated the LINK_DIRECTORIES with relative
path
But they are actually the same I guess these patterns should be STREQUAL but not "MATCHES"
add_library(target_link_directories_4 SHARED EXCLUDE_FROM_ALL LinkDirectoriesLib.c)
target_link_directories(target_link_directories_4 PRIVATE relative/dir)
get_target_property(result target_link_directories_4 LINK_DIRECTORIES)
if (NOT result MATCHES "${CMAKE_CURRENT_SOURCE_DIR}/relative/dir")
message(SEND_ERROR "target_link_directories not populated the LINK_DIRECTORIES with relative path")
endif()
add_subdirectory(subdir)
target_link_directories(target_link_directories_5 PRIVATE relative/dir)
get_target_property(result target_link_directories_5 LINK_DIRECTORIES)
if (NOT result MATCHES "${CMAKE_CURRENT_SOURCE_DIR}/relative/dir")
message(SEND_ERROR "target_link_directories not populated the LINK_DIRECTORIES with relative path")
endif()
Edited by Brad King