2019-05-03 13:57:43 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO STEllAR-GROUP/hpx
|
2021-08-19 08:07:51 +08:00
|
|
|
REF 1.7.1
|
|
|
|
SHA512 6bdb294da393a198abf81d5f63799a066334755eed0fda40bbfc4e9a774b6e19a3e5ad7ab45c989d31f3797e7b547bb552c29f51b552d9a79d166f86aee375a3
|
2019-09-28 02:16:02 +08:00
|
|
|
HEAD_REF stable
|
2022-02-16 08:59:58 +08:00
|
|
|
PATCHES fix-dependency-hwloc.patch
|
2019-05-03 13:57:43 +08:00
|
|
|
)
|
|
|
|
|
2021-11-30 00:40:37 +08:00
|
|
|
set(HPX_WITH_MALLOC system)
|
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
|
|
|
# This is done at the request of the hpx maintainers; see
|
|
|
|
# https://github.com/microsoft/vcpkg/pull/21673#issuecomment-979904882
|
|
|
|
# It must match when gperftools is treated as a dependency of this port.
|
|
|
|
set(HPX_WITH_MALLOC tcmalloc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-05-03 13:57:43 +08:00
|
|
|
OPTIONS
|
|
|
|
-DHPX_WITH_VCPKG=ON
|
|
|
|
-DHPX_WITH_TESTS=OFF
|
|
|
|
-DHPX_WITH_EXAMPLES=OFF
|
|
|
|
-DHPX_WITH_TOOLS=OFF
|
|
|
|
-DHPX_WITH_RUNTIME=OFF
|
2021-11-30 00:40:37 +08:00
|
|
|
"-DHPX_WITH_MALLOC=${HPX_WITH_MALLOC}"
|
2019-05-03 13:57:43 +08:00
|
|
|
)
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-05-03 13:57:43 +08:00
|
|
|
|
|
|
|
# post build cleanup
|
2021-11-10 03:45:40 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/HPX)
|
2019-05-03 13:57:43 +08: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-29 13:38:07 +08:00
|
|
|
vcpkg_replace_string(
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/HPXMacros.cmake"
|
2021-02-21 13:28:57 +08:00
|
|
|
"set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH}"
|
|
|
|
"list(APPEND CMAKE_MODULE_PATH")
|
2019-05-03 13:57:43 +08:00
|
|
|
|
|
|
|
file(INSTALL
|
2021-11-10 03:45:40 +08:00
|
|
|
"${SOURCE_PATH}/LICENSE_1_0.txt"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2019-05-03 13:57:43 +08:00
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
|
2019-05-03 13:57:43 +08:00
|
|
|
if(DLLS)
|
2021-11-10 03:45:40 +08:00
|
|
|
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
|
2019-05-03 13:57:43 +08:00
|
|
|
file(REMOVE ${DLLS})
|
|
|
|
endif()
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/hpx/*.dll")
|
2019-05-03 13:57:43 +08:00
|
|
|
if(DLLS)
|
2021-11-10 03:45:40 +08:00
|
|
|
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin/hpx")
|
2019-05-03 13:57:43 +08:00
|
|
|
file(REMOVE ${DLLS})
|
|
|
|
endif()
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
|
2019-05-03 13:57:43 +08:00
|
|
|
if(DLLS)
|
2021-11-10 03:45:40 +08:00
|
|
|
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2019-05-03 13:57:43 +08:00
|
|
|
file(REMOVE ${DLLS})
|
|
|
|
endif()
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/hpx/*.dll")
|
2019-05-03 13:57:43 +08:00
|
|
|
if(DLLS)
|
2021-11-10 03:45:40 +08:00
|
|
|
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin/hpx")
|
2019-05-03 13:57:43 +08:00
|
|
|
file(REMOVE ${DLLS})
|
|
|
|
endif()
|
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-05-03 13:57:43 +08:00
|
|
|
|
2021-11-10 03:45:40 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/hpxcxx" "\"${CURRENT_PACKAGES_DIR}\"" "os.path.dirname(os.path.dirname(os.path.realpath(__file__)))")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/hpxcxx" "\"${CURRENT_PACKAGES_DIR}/debug\"" "os.path.dirname(os.path.dirname(os.path.realpath(__file__)))")
|
2021-12-02 11:21:10 +08:00
|
|
|
file(REMOVE "${CURRENT_PACKAGES_DIR}/share/hpx/HPXCacheVariables.cmake")
|
2019-05-03 13:57:43 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|