Browse Source

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

This helps CMake's export generator understand the expression.
Sam Edwards 7 years ago
parent
commit
e49306fec9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      cmake/macros/BuildMetalib.cmake

+ 2 - 2
cmake/macros/BuildMetalib.cmake

@@ -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.