CMake: Wrap target names in $<TARGET_NAME:...>

This helps CMake's export generator understand the expression.
This commit is contained in:
Sam Edwards 2018-11-27 22:42:15 -07:00
parent 8df53698f4
commit e49306fec9
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ if(CMAKE_VERSION VERSION_LESS "3.12")
set(is_object "$<STREQUAL:$<TARGET_PROPERTY:${library},TYPE>,OBJECT_LIBRARY>")
set(is_component "$<BOOL:$<${is_object}:${is_component}>>")
set(name_of_component "$<${is_component}:${library}>")
set(name_of_non_component "$<$<NOT:${is_component}>:${library}>")
set(name_of_component "$<${is_component}:$<TARGET_NAME:${library}>>")
set(name_of_non_component "$<$<NOT:${is_component}>:$<TARGET_NAME:${library}>>")
endif()
# Libraries are only linked transitively if they aren't components.