Skip to content

Commit

Permalink
Merge #5905
Browse files Browse the repository at this point in the history
5905: Fix incorrect usage of generator expressions r=hkaiser a=Neumann-A

`$<TARGET_NAME:...>` is required for the install interface

Don't yet know what all the code does but it generates wrong stuff in the INSTALL_INTERFACE which needs to be informed about target names. 

see
https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#genex:TARGET_NAME

Fixes using static exports of HPX on windows. 


Co-authored-by: Alexander Neumann <[email protected]>
Co-authored-by: Neumann-A <[email protected]>
Co-authored-by: Hartmut Kaiser <[email protected]>
  • Loading branch information
3 people committed Jun 3, 2022
2 parents 28e0182 + 00d68c8 commit 7add8c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmake/HPX_AddModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ function(add_hpx_module libname modulename)
elseif(MSVC)
set(_module_target hpx_${modulename})
target_link_libraries(
hpx_${libname} PRIVATE -WHOLEARCHIVE:$<TARGET_FILE:hpx_${modulename}>
hpx_${libname}
PRIVATE -WHOLEARCHIVE:$<TARGET_FILE:$<TARGET_NAME:hpx_${modulename}>>
)
endif()
target_link_libraries(hpx_${libname} PRIVATE ${_module_target})
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_GeneratePackageUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function(
)
else()
set(_libraries
$<INSTALL_INTERFACE:-L${CMAKE_INSTALL_LIBDIR};-l$<TARGET_FILE_BASE_NAME:${target}>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
$<INSTALL_INTERFACE:-L${CMAKE_INSTALL_LIBDIR};-l$<TARGET_FILE_BASE_NAME:$<TARGET_NAME:${target}>>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
)
endif()
else()
Expand All @@ -101,7 +101,7 @@ function(
)
set(_libraries
${_libraries}
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${target}>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:$<TARGET_NAME:${target}>>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
)
endif()
elseif("${dep_target}" MATCHES "^-l")
Expand Down

0 comments on commit 7add8c1

Please sign in to comment.