vcpkg/ports/asio/portfile.cmake

23 lines
1016 B
CMake
Raw Normal View History

2016-10-27 02:49:01 +08:00
#header-only library
include(vcpkg_common_functions)
2017-12-30 06:22:14 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO chriskohlhoff/asio
2018-03-20 04:40:39 +08:00
REF asio-1-12-0
SHA512 a0e341fd6a848784e1533df84d1e6b361c8468f59d4fbde68c1500c1f8a2124ad78db0169098dbbc594ce26717eb9760f37af13cb288a549e2bda563eecf2be3
2017-12-30 06:22:14 +08:00
HEAD_REF master
2016-10-04 08:03:45 +08:00
)
# Handle copyright
2017-12-30 06:22:14 +08:00
file(COPY ${SOURCE_PATH}/asio/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
2016-10-04 08:03:45 +08:00
# Copy the asio header files
2017-12-30 06:22:14 +08:00
file(INSTALL ${SOURCE_PATH}/asio/include DESTINATION ${CURRENT_PACKAGES_DIR} FILES_MATCHING PATTERN "*.hpp" PATTERN "*.ipp")
# Always use "ASIO_STANDALONE" to avoid boost dependency
file(READ "${CURRENT_PACKAGES_DIR}/include/asio/detail/config.hpp" _contents)
string(REPLACE "defined(ASIO_STANDALONE)" "!defined(VCPKG_DISABLE_ASIO_STANDALONE)" _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/include/asio/detail/config.hpp" "${_contents}")