early-access version 2853
This commit is contained in:
29
externals/vcpkg/ports/poppler/cmake-project-include.cmake
vendored
Executable file
29
externals/vcpkg/ports/poppler/cmake-project-include.cmake
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
if("${FONT_CONFIGURATION}" STREQUAL "fontconfig")
|
||||
# Poppler uses different variable names than CMake.
|
||||
find_package(Fontconfig REQUIRED)
|
||||
set(FONTCONFIG_DEFINITIONS "")
|
||||
set(FONTCONFIG_INCLUDE_DIR "${Fontconfig_INCLUDE_DIRS}")
|
||||
set(FONTCONFIG_LIBRARIES "Fontconfig::Fontconfig")
|
||||
endif()
|
||||
|
||||
# Poppler uses different variable names than CMake,
|
||||
# plus ICONV_SECOND_ARGUMENT_IS_CONST
|
||||
find_package(Iconv REQUIRED)
|
||||
set(ICONV_INCLUDE_DIR "${Iconv_INCLUDE_DIR}")
|
||||
set(ICONV_LIBRARIES "${Iconv_LIBRARIES}")
|
||||
|
||||
# Create helper file for iconv usage requirement
|
||||
set(poppler_iconv [[
|
||||
Name: poppler-vcpkg-iconv
|
||||
Description: iconv linking requirements for poppler
|
||||
Version: 0
|
||||
Libs:]])
|
||||
string(TOLOWER "${Iconv_LIBRARIES}" iconv_libraries)
|
||||
if(iconv_libraries MATCHES "iconv")
|
||||
string(APPEND poppler_iconv " -liconv")
|
||||
endif()
|
||||
if(iconv_libraries MATCHES "charset")
|
||||
string(APPEND poppler_iconv " -lcharset")
|
||||
endif()
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/poppler-vcpkg-iconv.pc" "${poppler_iconv}")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/poppler-vcpkg-iconv.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
36
externals/vcpkg/ports/poppler/export-unofficial-poppler.patch
vendored
Executable file
36
externals/vcpkg/ports/poppler/export-unofficial-poppler.patch
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9a0dcb1..c1f2f02 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -585,9 +585,16 @@ if(MINGW AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(poppler PROPERTIES SUFFIX "-${POPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
target_link_libraries(poppler LINK_PRIVATE ${poppler_LIBS})
|
||||
-install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+target_include_directories(poppler PUBLIC $<INSTALL_INTERFACE:include/poppler>)
|
||||
+set_target_properties(poppler PROPERTIES EXPORT_NAME poppler-private)
|
||||
+install(TARGETS poppler EXPORT unofficial-poppler-targets RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(EXPORT unofficial-poppler-targets NAMESPACE unofficial::poppler:: DESTINATION share/unofficial-poppler)
|
||||
|
||||
if(ENABLE_UNSTABLE_API_ABI_HEADERS)
|
||||
+ target_include_directories(poppler PUBLIC
|
||||
+ $<INSTALL_INTERFACE:include/poppler/fofi>
|
||||
+ $<INSTALL_INTERFACE:include/poppler/goo>
|
||||
+ )
|
||||
install(FILES
|
||||
poppler/Annot.h
|
||||
poppler/AnnotStampImageHelper.h
|
||||
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
|
||||
index c37936b..344933c 100644
|
||||
--- a/cpp/CMakeLists.txt
|
||||
+++ b/cpp/CMakeLists.txt
|
||||
@@ -32,7 +32,8 @@ if(MINGW AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES})
|
||||
-install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(TARGETS poppler-cpp EXPORT unofficial-poppler-cpp-targets RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+install(EXPORT unofficial-poppler-cpp-targets NAMESPACE unofficial::poppler:: DESTINATION share/unofficial-poppler)
|
||||
|
||||
install(FILES
|
||||
poppler-destination.h
|
||||
76
externals/vcpkg/ports/poppler/portfile.cmake
vendored
Executable file
76
externals/vcpkg/ports/poppler/portfile.cmake
vendored
Executable file
@@ -0,0 +1,76 @@
|
||||
vcpkg_from_gitlab(
|
||||
GITLAB_URL https://gitlab.freedesktop.org
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO poppler/poppler
|
||||
REF poppler-22.03.0
|
||||
SHA512 0229e50bbf21154f398480730649fd15ca37c7edae5abd63ed41ab722852d09e4dc2b9df66b13b1cfe3e7a0da945916e1bd39c75c4879ded2759eb465f69424a
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
export-unofficial-poppler.patch
|
||||
)
|
||||
file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindFontconfig.cmake")
|
||||
|
||||
set(POPPLER_PC_REQUIRES "freetype2 libjpeg libopenjp2 libpng libtiff-4 poppler-vcpkg-iconv")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
cairo WITH_Cairo
|
||||
curl ENABLE_LIBCURL
|
||||
private-api ENABLE_UNSTABLE_API_ABI_HEADERS
|
||||
zlib ENABLE_ZLIB
|
||||
)
|
||||
if("fontconfig" IN_LIST FEATURES)
|
||||
list(APPEND FEATURE_OPTIONS "-DFONT_CONFIGURATION=fontconfig")
|
||||
string(APPEND POPPLER_PC_REQUIRES " fontconfig")
|
||||
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()
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
-DBUILD_GTK_TESTS=OFF
|
||||
-DBUILD_QT5_TESTS=OFF
|
||||
-DBUILD_QT6_TESTS=OFF
|
||||
-DBUILD_CPP_TESTS=OFF
|
||||
-DBUILD_MANUAL_TESTS=OFF
|
||||
-DENABLE_UTILS=OFF
|
||||
-DENABLE_GLIB=OFF
|
||||
-DENABLE_GOBJECT_INTROSPECTION=OFF
|
||||
-DENABLE_QT5=OFF
|
||||
-DENABLE_QT6=OFF
|
||||
-DENABLE_CMS=none
|
||||
-DRUN_GPERF_IF_PRESENT=OFF
|
||||
-DENABLE_RELOCATABLE=OFF # https://gitlab.freedesktop.org/poppler/poppler/-/issues/1209
|
||||
-DWITH_NSS3=OFF
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
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)
|
||||
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/poppler.pc" "Libs:" "Requires.private: ${POPPLER_PC_REQUIRES}\nLibs:")
|
||||
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/poppler.pc" "Libs:" "Requires.private: ${POPPLER_PC_REQUIRES}\nLibs:")
|
||||
endif()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
22
externals/vcpkg/ports/poppler/unofficial-poppler-config.cmake
vendored
Executable file
22
externals/vcpkg/ports/poppler/unofficial-poppler-config.cmake
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
include(CMakeFindDependencyMacro)
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
set(features "@FEATURES@")
|
||||
find_dependency(Boost)
|
||||
if("fontconfig" IN_LIST features)
|
||||
find_dependency(Fontconfig) # CMake 3.14
|
||||
endif()
|
||||
find_dependency(Freetype)
|
||||
find_dependency(JPEG)
|
||||
find_dependency(PNG)
|
||||
find_dependency(TIFF)
|
||||
find_dependency(OpenJPEG CONFIG)
|
||||
if("curl" IN_LIST features)
|
||||
find_dependency(CURL)
|
||||
endif()
|
||||
if("zlib" IN_LIST features)
|
||||
find_dependency(ZLIB)
|
||||
endif()
|
||||
find_dependency(Iconv) # CMake 3.11
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-poppler-targets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-poppler-cpp-targets.cmake")
|
||||
6
externals/vcpkg/ports/poppler/usage
vendored
Executable file
6
externals/vcpkg/ports/poppler/usage
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
The package poppler can be imported via CMake FindPkgConfig module:
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(POPPLER_CPP REQUIRED IMPORTED_TARGET poppler-cpp)
|
||||
|
||||
target_link_libraries(main PRIVATE PkgConfig::POPPLER_CPP)
|
||||
83
externals/vcpkg/ports/poppler/vcpkg.json
vendored
Executable file
83
externals/vcpkg/ports/poppler/vcpkg.json
vendored
Executable file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "poppler",
|
||||
"version": "22.3.0",
|
||||
"port-version": 1,
|
||||
"description": "A PDF rendering library",
|
||||
"homepage": "https://poppler.freedesktop.org/",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"boost-container",
|
||||
"boost-move",
|
||||
"freetype",
|
||||
"libiconv",
|
||||
"libjpeg-turbo",
|
||||
"libpng",
|
||||
"openjpeg",
|
||||
"tiff",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"font-configuration",
|
||||
"zlib"
|
||||
],
|
||||
"features": {
|
||||
"cairo": {
|
||||
"description": "Enable the Cairo graphics backend",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "cairo",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"curl": {
|
||||
"description": "curl for poppler",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"font-configuration": {
|
||||
"description": "Defaut font configuration backend",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "poppler",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"fontconfig"
|
||||
],
|
||||
"platform": "!windows & !android"
|
||||
}
|
||||
]
|
||||
},
|
||||
"fontconfig": {
|
||||
"description": "Use fontconfig",
|
||||
"supports": "!windows, mingw",
|
||||
"dependencies": [
|
||||
"fontconfig"
|
||||
]
|
||||
},
|
||||
"private-api": {
|
||||
"description": "Install headers for private API (aka unstable API/ABI headers)"
|
||||
},
|
||||
"splash": {
|
||||
"description": "The splash backend is always enabled. This option is kept for compatibility."
|
||||
},
|
||||
"zlib": {
|
||||
"description": "zlib for poppler",
|
||||
"dependencies": [
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user