2022-09-19 21:30:40 +02:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
endif()
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HPX_WITH_STATIC_LINKING)
|
2019-05-02 22:57:43 -07:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO STEllAR-GROUP/hpx
|
2023-08-17 16:18:58 -05:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 a7972beada950cf6ef3b61f20496a08b220e4f48c28c11d57c20683906ca5124a9f36ac2552318883a5ab1db6efdbf63d1141b6e0c484c560a8c1311ae2d7090
|
2019-09-27 11:16:02 -07:00
|
|
|
HEAD_REF stable
|
2022-03-11 17:19:27 -06:00
|
|
|
PATCHES
|
|
|
|
fix-dependency-hwloc.patch
|
2022-09-19 21:30:40 +02:00
|
|
|
fix-debug.patch
|
|
|
|
fix_output_name_clash.patch
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"zlib" HPX_WITH_COMPRESSION_ZLIB
|
|
|
|
"snappy" HPX_WITH_COMPRESSION_SNAPPY
|
|
|
|
"bzip2" HPX_WITH_COMPRESSION_BZIP2
|
|
|
|
"cuda" HPX_WITH_CUDA
|
|
|
|
"mpi" HPX_WITH_PARCELPORT_MPI
|
|
|
|
"mpi" HPX_WITH_PARCELPORT_MPI_MULTITHREADED
|
2019-05-02 22:57:43 -07:00
|
|
|
)
|
|
|
|
|
2022-09-19 21:30:40 +02:00
|
|
|
if(NOT VCPKG_TARGET_ARCHITECTURE MATCHES "(x64|x86)")
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DHPX_WITH_GENERIC_CONTEXT_COROUTINES=ON")
|
2021-11-29 08:40:37 -08:00
|
|
|
endif()
|
|
|
|
|
2022-09-19 21:30:40 +02:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindBZip2.cmake") # Outdated
|
2021-11-29 08:40:37 -08:00
|
|
|
|
2021-11-09 20:45:40 +01:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-05-02 22:57:43 -07:00
|
|
|
OPTIONS
|
|
|
|
-DHPX_WITH_VCPKG=ON
|
|
|
|
-DHPX_WITH_TESTS=OFF
|
|
|
|
-DHPX_WITH_EXAMPLES=OFF
|
|
|
|
-DHPX_WITH_TOOLS=OFF
|
|
|
|
-DHPX_WITH_RUNTIME=OFF
|
2022-05-26 22:14:21 +02:00
|
|
|
-DHPX_USE_CMAKE_CXX_STANDARD=ON
|
2022-09-19 21:30:40 +02:00
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DHPX_WITH_PKGCONFIG=OFF
|
|
|
|
-DHPX_WITH_STATIC_LINKING=${HPX_WITH_STATIC_LINKING}
|
|
|
|
-DHPX_WITH_PARCELPORT_TCP=ON
|
|
|
|
-DHPX_WITH_THREAD_TARGET_ADDRESS=ON
|
|
|
|
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=ON
|
|
|
|
-DHPX_WITH_THREAD_IDLE_RATES=ON
|
|
|
|
-DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET}
|
2019-05-02 22:57:43 -07:00
|
|
|
)
|
2021-11-09 20:45:40 +01:00
|
|
|
vcpkg_cmake_install()
|
2019-05-02 22:57:43 -07:00
|
|
|
|
|
|
|
# post build cleanup
|
2021-11-09 20:45:40 +01:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/HPX)
|
2019-05-02 22:57:43 -07:00
|
|
|
|
|
|
|
file(GLOB_RECURSE CMAKE_FILES "${CURRENT_PACKAGES_DIR}/share/hpx/*.cmake")
|
|
|
|
foreach(CMAKE_FILE IN LISTS CMAKE_FILES)
|
|
|
|
file(READ ${CMAKE_FILE} _contents)
|
|
|
|
string(REGEX REPLACE
|
|
|
|
"lib/([A-Za-z0-9_.-]+\\.dll)"
|
|
|
|
"bin/\\1"
|
|
|
|
_contents "${_contents}")
|
|
|
|
string(REGEX REPLACE
|
|
|
|
"lib/hpx/([A-Za-z0-9_.-]+\\.dll)"
|
|
|
|
"bin/hpx/\\1"
|
|
|
|
_contents "${_contents}")
|
|
|
|
file(WRITE ${CMAKE_FILE} "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
2020-10-21 05:43:10 +08:00
|
|
|
vcpkg_replace_string(
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/HPXConfig.cmake"
|
|
|
|
"set(HPX_BUILD_TYPE \"Release\")"
|
|
|
|
"set(HPX_BUILD_TYPE \"\${CMAKE_BUILD_TYPE}\")")
|
|
|
|
|
2020-02-28 23:38:07 -06:00
|
|
|
vcpkg_replace_string(
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/HPXMacros.cmake"
|
2021-02-20 23:28:57 -06:00
|
|
|
"set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH}"
|
|
|
|
"list(APPEND CMAKE_MODULE_PATH")
|
2019-05-02 22:57:43 -07:00
|
|
|
|
|
|
|
file(INSTALL
|
2021-11-09 20:45:40 +01:00
|
|
|
"${SOURCE_PATH}/LICENSE_1_0.txt"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2019-05-02 22:57:43 -07:00
|
|
|
|
2021-11-09 20:45:40 +01:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-05-02 22:57:43 -07:00
|
|
|
|
2021-11-09 20:45:40 +01:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2022-09-19 21:30:40 +02:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/hpxcxx" "${CURRENT_PACKAGES_DIR}/debug/bin/hpxcxx")
|
|
|
|
|
2023-08-17 16:18:58 -05:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/hpxrun.py")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/hpxrun.py" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/hpxrun.py")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/hpxrun.py" "'${CURRENT_INSTALLED_DIR}/tools/openmpi/bin/mpiexec'" "'mpiexec'")
|
|
|
|
endif()
|
2022-09-19 21:30:40 +02:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
|