2018-04-17 16:19:59 -07:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
2018-03-11 23:41:51 -07:00
|
|
|
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
2019-09-05 03:20:38 +08:00
|
|
|
if (NOT EXISTS "/usr/include/libintl.h")
|
|
|
|
message(FATAL_ERROR "Please use command \"sudo apt-get install gettext\" to install gettext on linux.")
|
|
|
|
endif()
|
2019-02-08 00:24:33 +01:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/unofficial-gettext-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/unofficial-gettext)
|
2018-03-11 23:41:51 -07:00
|
|
|
return()
|
|
|
|
endif()
|
2016-11-01 20:12:26 +01:00
|
|
|
|
|
|
|
#Based on https://github.com/winlibs/gettext
|
|
|
|
|
|
|
|
include(vcpkg_common_functions)
|
2019-02-08 00:24:33 +01:00
|
|
|
|
|
|
|
set(GETTEXT_VERSION 0.19)
|
|
|
|
|
2016-11-01 20:12:26 +01:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2019-02-08 00:24:33 +01:00
|
|
|
URLS "https://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz"
|
|
|
|
FILENAME "gettext-${GETTEXT_VERSION}.tar.gz"
|
2016-11-01 20:12:26 +01:00
|
|
|
SHA512 a5db035c582ff49d45ee6eab9466b2bef918e413a882019c204a9d8903cb3770ddfecd32c971ea7c7b037c7b69476cf7c56dcabc8b498b94ab99f132516c9922
|
|
|
|
)
|
2019-02-08 00:24:33 +01:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${GETTEXT_VERSION}
|
|
|
|
PATCHES
|
|
|
|
0001-Fix-macro-definitions.patch
|
|
|
|
0002-Fix-uwp-build.patch
|
|
|
|
)
|
2016-11-01 20:12:26 +01:00
|
|
|
|
2018-04-17 16:19:59 -07:00
|
|
|
file(COPY
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/config.win32.h
|
2018-12-05 18:41:01 -05:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/config.unix.h.in
|
2018-04-17 16:19:59 -07:00
|
|
|
DESTINATION ${SOURCE_PATH}/gettext-runtime
|
|
|
|
)
|
|
|
|
file(REMOVE ${SOURCE_PATH}/gettext-runtime/intl/libgnuintl.h ${SOURCE_PATH}/gettext-runtime/config.h)
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/libgnuintl.win32.h DESTINATION ${SOURCE_PATH}/gettext-runtime/intl)
|
2016-11-01 20:12:26 +01:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
2018-03-01 17:13:57 -08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}/gettext-runtime
|
|
|
|
PREFER_NINJA
|
2018-04-17 16:19:59 -07:00
|
|
|
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
|
2016-11-01 20:12:26 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2019-02-08 00:24:33 +01:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-gettext TARGET_PATH share/unofficial-gettext)
|
|
|
|
|
2016-11-01 20:12:26 +01:00
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/gettext)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/gettext/COPYING ${CURRENT_PACKAGES_DIR}/share/gettext/copyright)
|
2016-11-02 11:05:59 -07:00
|
|
|
|
2018-04-17 16:19:59 -07:00
|
|
|
vcpkg_copy_pdbs()
|