r21773 by craig - PoDoFo 0.95+ requires OpenSSL, add logic to find that too, still needs testing on that version though

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 11 20:52:12 UTC 2017


Author: craig
Date: Sat Feb 11 20:52:12 2017
New Revision: 21773

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21773
Log:
PoDoFo 0.95+ requires OpenSSL, add logic to find that too, still needs testing on that version though

Modified:
    trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake

Modified: trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21773&path=/trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake
==============================================================================
--- trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake	(original)
+++ trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake	Sat Feb 11 20:52:12 2017
@@ -34,19 +34,29 @@
 )
 
 if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
-  set(LIBPODOFO_FOUND TRUE CACHE BOOLEAN "Was libpodofo found")
-
-  file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
-  file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_MINOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MINOR[ \t]+[0-9]+$")
-  file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_PATCH_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_PATCH[ \t]+[0-9]+$")
-  string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+([0-9]+)$" "\\1" PODOFO_MAJOR_VER "${PODOFO_MAJOR_VER_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_MINOR[ \t]+([0-9]+)$" "\\1" PODOFO_MINOR_VER "${PODOFO_MINOR_VER_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_PATCH[ \t]+([0-9]+)$" "\\1" PODOFO_PATCH_VER "${PODOFO_PATCH_VER_LINE}")
-#  message(STATUS "PODOFO MAJOR VERSION ${PODOFO_MAJOR_VER}")
-#  message(STATUS "PODOFO MINOR VERSION ${PODOFO_MINOR_VER}")
-#  message(STATUS "PODOFO PATCH VERSION ${PODOFO_PATCH_VER}")
-  set(LIBPODOFO_VERSION "${PODOFO_MAJOR_VER}.${PODOFO_MINOR_VER}.${PODOFO_PATCH_VER}" CACHE STRING "PoDoFo version string")
-
+	file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
+	file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_MINOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MINOR[ \t]+[0-9]+$")
+	file(STRINGS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" PODOFO_PATCH_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_PATCH[ \t]+[0-9]+$")
+	string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+([0-9]+)$" "\\1" PODOFO_MAJOR_VER "${PODOFO_MAJOR_VER_LINE}")
+	string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_MINOR[ \t]+([0-9]+)$" "\\1" PODOFO_MINOR_VER "${PODOFO_MINOR_VER_LINE}")
+	string(REGEX REPLACE "^#define[ \t]+PODOFO_VERSION_PATCH[ \t]+([0-9]+)$" "\\1" PODOFO_PATCH_VER "${PODOFO_PATCH_VER_LINE}")
+	#message(STATUS "PODOFO MAJOR VERSION ${PODOFO_MAJOR_VER}")
+	#message(STATUS "PODOFO MINOR VERSION ${PODOFO_MINOR_VER}")
+	#message(STATUS "PODOFO PATCH VERSION ${PODOFO_PATCH_VER}")
+	set(LIBPODOFO_VERSION "${PODOFO_MAJOR_VER}.${PODOFO_MINOR_VER}.${PODOFO_PATCH_VER}" CACHE STRING "PoDoFo version string")
+	if(LIBPODOFO_VERSION VERSION_GREATER "0.9.4")
+		find_package(OPENSSL)
+		if (OPENSSL_FOUND)
+			message("OpenSSL found OK for installed version of PoDoFo (>= 0.9.5) - Enabling support for PDF embedded in AI")
+			set(LIBPODOFO_FOUND TRUE CACHE BOOLEAN "Was libpodofo found")
+		else()
+			message("OpenSSL NOT found for installed version of PoDoFo (>= 0.9.5) - Disabling support for PDF embedded in AI")
+			unset(LIBPODOFO_FOUND)
+		endif()
+	else()
+		message("OpenSSL NOT required for installed version of PoDoFo (< 0.9.5) - Enabling support for PDF embedded in AI")
+		set(LIBPODOFO_FOUND TRUE CACHE BOOLEAN "Was libpodofo found")
+	endif()
 endif(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
 
 set(LIBPODOFO_CFLAGS "${useshared}" CACHE STRING "Extra flags for compiling against PoDoFo")




More information about the scribus-commit mailing list