Skip to content

Commit

Permalink
Merge pull request #6513 from pefedotov/master
Browse files Browse the repository at this point in the history
custom FETCHCONTENT_BASE_DIR bug fix
  • Loading branch information
hkaiser committed Jun 24, 2024
2 parents 049b935 + 0887421 commit daa1fd5
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions cmake/HPX_SetupHwloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ else()
execute_process(
COMMAND
sh -c
"cd ${CMAKE_BINARY_DIR}/_deps/hwloc-src && ./configure --prefix=${CMAKE_BINARY_DIR}/_deps/hwloc-installed && make -j && make install"
"cd ${FETCHCONTENT_BASE_DIR}/hwloc-src && ./configure --prefix=${FETCHCONTENT_BASE_DIR}/hwloc-installed && make -j && make install"
)
endif()
set(HWLOC_ROOT "${CMAKE_BINARY_DIR}/_deps/hwloc-installed")
set(HWLOC_ROOT "${FETCHCONTENT_BASE_DIR}/hwloc-installed")
set(Hwloc_INCLUDE_DIR
${HWLOC_ROOT}/include
CACHE INTERNAL ""
Expand Down Expand Up @@ -84,7 +84,7 @@ else()
fetchcontent_populate(HWLoc)
endif()
set(HWLOC_ROOT
"${CMAKE_BINARY_DIR}/_deps/hwloc-src"
"${FETCHCONTENT_BASE_DIR}/hwloc-src"
CACHE INTERNAL ""
)
include_directories(${HWLOC_ROOT}/include)
Expand All @@ -108,15 +108,21 @@ else()
target_link_libraries(Hwloc::hwloc INTERFACE ${Hwloc_LIBRARY})

if(HPX_WITH_FETCH_HWLOC AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
if(RUNTIME_OUTPUT_DIRECTORY)
set(EXE_DIRECTORY_PATH "${RUNTIME_OUTPUT_DIRECTORY}")
else()
set(EXE_DIRECTORY_PATH "${CMAKE_BINARY_DIR}/$<CONFIG>/bin/")
endif()

set(DLL_PATH "${HWLOC_ROOT}/bin/libhwloc-15.dll")
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/"
COMMAND ${CMAKE_COMMAND} -E make_directory ${EXE_DIRECTORY_PATH}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DLL_PATH}
${EXE_DIRECTORY_PATH}
)
install(FILES ${DLL_PATH} DESTINATION ${CMAKE_INSTALL_BINDIR})
add_hpx_pseudo_target(HwlocDLL)
endif()

endif()

0 comments on commit daa1fd5

Please sign in to comment.