Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24761 → Rev 24762

/trunk/Scribus/cmake/modules/FindLIBPODOFO.cmake
31,20 → 31,27
)
 
if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
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]+$")
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")
endif()
 
file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MINOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MINOR[ \t]+[0-9]+$")
file(STRINGS "${LIBPODOFO_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}")
# 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")
# podofo 0.9.5 use OpenSSL includes in its public headers, we need to know OpenSSL include dirs
# (https://bugs.scribus.net/view.php?id=14838)
find_package(OpenSSL)
find_package(OpenSSL QUIET)
if (NOT OPENSSL_FOUND)
find_package(OPENSSL)
endif()
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 ON CACHE BOOL "Was libpodofo found")