2023-01-31 02:14:05 +01:00
|
|
|
string(REGEX REPLACE "^([0-9]+)[.]([0-9][.])" "\\1.0\\2" POPPLER_VERSION "${VERSION}")
|
2022-02-18 02:03:04 +01:00
|
|
|
vcpkg_from_gitlab(
|
|
|
|
GITLAB_URL https://gitlab.freedesktop.org
|
2021-01-05 04:27:23 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2022-02-18 02:03:04 +01:00
|
|
|
REPO poppler/poppler
|
2023-01-31 02:14:05 +01:00
|
|
|
REF "poppler-${POPPLER_VERSION}"
|
2024-03-08 06:44:39 +00:00
|
|
|
SHA512 5997af5698a793aefcc1d0d98ea2e0732c0ce0adfa1e5be182ba2d425b1691ba84dfa89f0cdafacf19756d411b2b2de665d1a4682acf21ad5d3353dfeac0727c
|
2021-01-05 04:27:23 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2022-02-18 02:03:04 +01:00
|
|
|
export-unofficial-poppler.patch
|
2024-03-06 08:47:04 +01:00
|
|
|
private-namespace.patch
|
2021-01-05 04:27:23 +08:00
|
|
|
)
|
2022-02-18 02:03:04 +01:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindFontconfig.cmake")
|
2021-01-05 04:27:23 +08:00
|
|
|
|
2022-02-18 02:03:04 +01:00
|
|
|
set(POPPLER_PC_REQUIRES "freetype2 libjpeg libopenjp2 libpng libtiff-4 poppler-vcpkg-iconv")
|
2021-01-13 12:05:11 +08:00
|
|
|
|
2021-01-05 04:27:23 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-02-18 02:03:04 +01:00
|
|
|
FEATURES
|
|
|
|
cairo WITH_Cairo
|
2023-06-14 21:17:29 +02:00
|
|
|
cairo CMAKE_REQUIRE_FIND_PACKAGE_CAIRO
|
2022-02-18 02:03:04 +01:00
|
|
|
curl ENABLE_LIBCURL
|
2023-06-14 21:17:29 +02:00
|
|
|
curl CMAKE_REQUIRE_FIND_PACKAGE_CURL
|
2022-02-18 02:03:04 +01:00
|
|
|
private-api ENABLE_UNSTABLE_API_ABI_HEADERS
|
|
|
|
zlib ENABLE_ZLIB
|
2023-06-14 21:17:29 +02:00
|
|
|
zlib CMAKE_REQUIRE_FIND_PACKAGE_ZLIB
|
|
|
|
glib ENABLE_GLIB
|
|
|
|
glib CMAKE_REQUIRE_FIND_PACKAGE_GLIB
|
2023-02-21 19:18:23 +01:00
|
|
|
qt ENABLE_QT6
|
2023-06-14 21:17:29 +02:00
|
|
|
qt CMAKE_REQUIRE_FIND_PACKAGE_Qt6
|
|
|
|
cms CMAKE_REQUIRE_FIND_PACKAGE_LCMS2
|
2023-12-07 23:35:37 -08:00
|
|
|
cms ENABLE_LCMS
|
2021-01-05 04:27:23 +08:00
|
|
|
)
|
2022-02-18 02:03:04 +01:00
|
|
|
if("fontconfig" IN_LIST FEATURES)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DFONT_CONFIGURATION=fontconfig")
|
|
|
|
string(APPEND POPPLER_PC_REQUIRES " fontconfig")
|
2023-12-07 23:35:37 -08:00
|
|
|
elseif(VCPKG_TARGET_IS_ANDROID)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DFONT_CONFIGURATION=android")
|
2022-02-18 02:03:04 +01:00
|
|
|
elseif(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DFONT_CONFIGURATION=win32")
|
|
|
|
else()
|
|
|
|
list(APPEND FEATURE_OPTIONS "-DFONT_CONFIGURATION=generic")
|
|
|
|
endif()
|
|
|
|
if("cairo" IN_LIST FEATURES)
|
|
|
|
string(APPEND POPPLER_PC_REQUIRES " cairo")
|
|
|
|
endif()
|
|
|
|
if("curl" IN_LIST FEATURES)
|
|
|
|
string(APPEND POPPLER_PC_REQUIRES " libcurl")
|
|
|
|
endif()
|
|
|
|
if("zlib" IN_LIST FEATURES)
|
|
|
|
string(APPEND POPPLER_PC_REQUIRES " zlib")
|
|
|
|
endif()
|
2021-01-05 04:27:23 +08:00
|
|
|
|
2023-12-07 23:35:37 -08:00
|
|
|
if("cms" IN_LIST FEATURES)
|
|
|
|
string(APPEND POPPLER_PC_REQUIRES " lcms2")
|
|
|
|
endif()
|
|
|
|
|
2022-02-18 02:03:04 +01:00
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
2022-12-14 10:11:34 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
2022-02-18 02:03:04 +01:00
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-01-05 04:27:23 +08:00
|
|
|
OPTIONS
|
2022-02-18 02:03:04 +01:00
|
|
|
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
|
|
|
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
2022-12-14 10:11:34 +08:00
|
|
|
"-DGLIB2_MKENUMS_PYTHON=${PYTHON3}"
|
2021-01-05 04:27:23 +08:00
|
|
|
-DBUILD_GTK_TESTS=OFF
|
|
|
|
-DBUILD_QT5_TESTS=OFF
|
|
|
|
-DBUILD_QT6_TESTS=OFF
|
|
|
|
-DBUILD_CPP_TESTS=OFF
|
2022-02-18 02:03:04 +01:00
|
|
|
-DBUILD_MANUAL_TESTS=OFF
|
2021-01-05 04:27:23 +08:00
|
|
|
-DENABLE_UTILS=OFF
|
2022-02-18 02:03:04 +01:00
|
|
|
-DENABLE_GOBJECT_INTROSPECTION=OFF
|
2021-01-05 04:27:23 +08:00
|
|
|
-DENABLE_QT5=OFF
|
2022-02-18 02:03:04 +01:00
|
|
|
-DRUN_GPERF_IF_PRESENT=OFF
|
|
|
|
-DENABLE_RELOCATABLE=OFF # https://gitlab.freedesktop.org/poppler/poppler/-/issues/1209
|
2023-12-07 23:35:37 -08:00
|
|
|
-DENABLE_NSS3=OFF
|
|
|
|
-DENABLE_GPGME=OFF
|
2023-06-14 21:17:29 +02:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_ECM=ON
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenJPEG=ON
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_JPEG=ON
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_TIFF=ON
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_PNG=ON
|
|
|
|
-DCMAKE_REQUIRE_FIND_PACKAGE_Boost=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GObjectIntrospection=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_GTK=ON
|
2021-01-05 04:27:23 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2023-06-14 21:17:29 +02:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_GObjectIntrospection
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_GTK
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_CAIRO
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_CURL
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_GLIB
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_LCMS2
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_Qt6
|
2021-01-05 04:27:23 +08:00
|
|
|
)
|
2022-02-18 02:03:04 +01:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-poppler-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-poppler/unofficial-poppler-config.cmake" @ONLY)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-poppler)
|
2021-01-05 04:27:23 +08:00
|
|
|
|
2022-02-18 02:03:04 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/poppler.pc" "Libs:" "Requires.private: ${POPPLER_PC_REQUIRES}\nLibs:")
|
2023-01-31 02:14:05 +01:00
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
2022-02-18 02:03:04 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/poppler.pc" "Libs:" "Requires.private: ${POPPLER_PC_REQUIRES}\nLibs:")
|
|
|
|
endif()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2023-06-14 21:17:29 +02:00
|
|
|
vcpkg_copy_pdbs()
|
2021-01-05 04:27:23 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
2024-02-09 06:51:08 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
2023-02-10 02:59:04 +08:00
|
|
|
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|