void-packages/srcpkgs/scribus/patches/0005-podofo-0.10-find-podof...

38 lines
1.8 KiB
Diff

From 3d02faaa2e17eef67826abd52d56b4a9b2b9c1ba Mon Sep 17 00:00:00 2001
From: Craig Bradney <mrb@scribus.info>
Date: Sun, 4 Jun 2023 17:00:34 +0000
Subject: [PATCH 01/13] Update CMake PoDoFo finder to allow for PoDoFo 0.10.0
podofo-config.h location
git-svn-id: svn://scribus.net/trunk/Scribus@25493 11d20701-8431-0410-a711-e3c959e3b870
(cherry picked from commit bd70705c05bd383d1a9b3ab12224988ff8475722)
---
cmake/modules/FindLIBPODOFO.cmake | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/cmake/modules/FindLIBPODOFO.cmake
+++ b/cmake/modules/FindLIBPODOFO.cmake
@@ -32,7 +32,14 @@ find_library(LIBPODOFO_LIBRARY
if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
if(NOT LIBPODOFO_CONFIG_H)
- set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
+ #PoDoFo before 0.10.0
+ if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h")
+ set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo <=0.10.0")
+ endif()
+ #PoDoFo 0.10.0 or higher
+ if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h")
+ set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo >=0.10.0")
+ endif()
endif()
file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
@@ -79,4 +86,6 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
message("podofo lib: not found")
endif(LIBPODOFO_LIBRARY)
message("PoDoFo cflags: ${useshared}")
+ message("PoDoFo config file ${LIBPODOFO_CONFIG_H}")
+ message("PoDoFo version ${LIBPODOFO_VERSION}")
endif(NOT LIBPODOFO_FIND_QUIETLY)