vcpkg/ports/date/portfile.cmake

39 lines
1.2 KiB
CMake
Raw Normal View History

2017-08-16 03:47:23 +08:00
include(vcpkg_common_functions)
2017-09-01 07:06:18 +08:00
message(WARNING
"You will need to also install http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml into your install location"
"See https://howardhinnant.github.io/date/tz.html"
)
2017-08-16 03:47:23 +08:00
vcpkg_from_github(
2017-09-01 07:06:18 +08:00
OUT_SOURCE_PATH SOURCE_PATH
REPO HowardHinnant/date
2017-11-23 06:58:39 +08:00
REF c286981b3bf83c79554769df68b27415cee68d77
SHA512 226e2cbc2598fbbe3a451664b017ab5b4314a682a9303268bd531931ea23baa4c9677c4433a87dbbc4a7d960dcfad1fcb632ac430d5d81c9909bcc567cf7eadf
2017-09-01 07:06:18 +08:00
HEAD_REF master
2017-08-16 03:47:23 +08:00
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
2017-09-01 07:06:18 +08:00
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
2017-08-16 03:47:23 +08:00
)
vcpkg_install_cmake()
2017-09-01 07:06:18 +08:00
vcpkg_copy_pdbs()
2017-08-16 03:47:23 +08:00
2017-11-18 07:46:20 +08:00
set(HEADER "${CURRENT_PACKAGES_DIR}/include/date/tz.h")
2017-09-01 07:06:18 +08:00
file(READ "${HEADER}" _contents)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
string(REPLACE "DATE_BUILD_DLL" "1" _contents "${_contents}")
else()
string(REPLACE "DATE_BUILD_LIB" "1" _contents "${_contents}")
endif()
file(WRITE "${HEADER}" "${_contents}")
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/date RENAME copyright)