Skip to content

Commit

Permalink
Merge pull request #6427 from vrnimje/hwloc_dll
Browse files Browse the repository at this point in the history
Modifying CMakeLists to copy libhwloc-15.dll to the binary folder in Windows, independently
  • Loading branch information
hkaiser authored Feb 13, 2024
2 parents e47a884 + 7959daf commit e4a8eb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2332,18 +2332,6 @@ endif()

if(HPX_WITH_EXAMPLES)
add_hpx_pseudo_target(examples)
if(HPX_WITH_FETCH_HWLOC AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
add_custom_target(
HwlocDLL ALL
COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_BINARY_DIR}/$<CONFIG>/bin/"
COMMAND
${CMAKE_COMMAND} -E copy_if_different
"${HWLOC_ROOT}/bin/libhwloc-15.dll"
"${CMAKE_BINARY_DIR}/$<CONFIG>/bin/"
)
add_hpx_pseudo_dependencies(examples HwlocDLL)
endif()
endif()

# ##############################################################################
Expand Down
13 changes: 13 additions & 0 deletions cmake/HPX_SetupHwloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,17 @@ else()
add_library(Hwloc::hwloc INTERFACE IMPORTED)
target_include_directories(Hwloc::hwloc INTERFACE ${Hwloc_INCLUDE_DIR})
target_link_libraries(Hwloc::hwloc INTERFACE ${Hwloc_LIBRARY})

if(HPX_WITH_FETCH_HWLOC AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
add_custom_target(
HwlocDLL ALL
COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_BINARY_DIR}/$<CONFIG>/bin/"
COMMAND
${CMAKE_COMMAND} -E copy_if_different
"${HWLOC_ROOT}/bin/libhwloc-15.dll"
"${CMAKE_BINARY_DIR}/$<CONFIG>/bin/"
)
add_hpx_pseudo_target(HwlocDLL)
endif()
endif()

0 comments on commit e4a8eb8

Please sign in to comment.