Commit 2cae1afc authored by ale rimoldi's avatar ale rimoldi

remove the FindPOPPLER file and do everyging in _Dependnecies

parent 63026e6c
Pipeline #100275710 passed with stage
in 10 minutes and 22 seconds
##############################################################################################################
########## Find Dependencies ##########
# For Poppler
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
#<< Qt
set(QT_MIN_VERSION "5.10.0")
set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
......@@ -299,12 +302,17 @@ endif()
#>> GraphicsMagick for image import
#<<Poppler for PDF import
find_package(POPPLER REQUIRED)
pkg_search_module(POPPLER IMPORTED_TARGET libpoppler>=0.58 poppler>=0.58)
if (POPPLER_FOUND)
pkg_search_module(POPPLER_CPP REQUIRED IMPORTED_TARGET libpoppler-cpp>=0.58 poppler-cpp>=0.58)
set(HAVE_POPPLER ON)
set(POPPLER_LIBRARY PkgConfig::POPPLER PkgConfig::POPPLER_CPP)
message(STATUS "Found poppler")
message(STATUS "Found poppler libs: ${POPPLER_LIBRARY}")
message(STATUS "Found poppler includes: ${POPPLER_INCLUDE_DIR}")
message(STATUS "Found poppler includes: ${POPPLER_INCLUDE_DIRS}")
message(STATUS "Found poppler-cpp includes: ${POPPLER_CPP_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "Could not find poppler library")
endif()
......
include(FindPkgConfig)
pkg_search_module(POPPLER libpoppler>=0.58.0 poppler>=0.58.0)
if (POPPLER_FOUND)
pkg_search_module(POPPLER_CPP REQUIRED libpoppler-cpp>=0.58.0 poppler-cpp>=0.58.0)
endif(POPPLER_FOUND)
find_path(POPPLER_INCLUDE_DIR
NAMES poppler-config.h
PATHS ${PKG_POPPLER_INCLUDE_DIRS} ${POPPLER_INCLUDE_DIRS}
PATH_SUFFIXES poppler
NO_DEFAULT_PATH
)
find_path(POPPLER_CPP_INCLUDE_DIR
NAMES poppler-version.h
PATHS ${PKG_POPPLER_CPP_INCLUDE_DIRS} ${POPPLER_CPP_INCLUDE_DIRS}
PATH_SUFFIXES poppler
NO_DEFAULT_PATH
)
find_library(POPPLER_LIBRARY
NAMES libpoppler poppler
PATHS ${PKG_POPPLER_LIBRARIES} ${POPPLER_LIBRARY_DIRS} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
PATH_SUFFIXES poppler
NO_DEFAULT_PATH
)
find_library(POPPLER_CPP_LIBRARY
NAMES libpoppler-cpp poppler-cpp
PATHS ${PKG_POPPLER_CPP_LIBRARIES} ${POPPLER_CPP_LIBRARY_DIRS} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
PATH_SUFFIXES poppler
NO_DEFAULT_PATH
)
if (POPPLER_LIBRARY)
if (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR)
set( FOUND_POPPLER ON )
set( POPPLER_LIBRARIES ${POPPLER_LIBRARY} ${POPPLER_CPP_LIBRARY} )
set( POPPLER_INCLUDES ${POPPLER_INCLUDE_DIR} ${POPPLER_CPP_INCLUDE_DIR} )
endif (POPPLER_INCLUDE_DIR AND POPPLER_CPP_INCLUDE_DIR)
endif (POPPLER_LIBRARY)
......@@ -18,7 +18,7 @@ for which a new license (GPL+exception) is in place.
#include <QRegExp>
#include <QStack>
// <include poppler>
// <poppler>
#include <ErrorCodes.h>
#include <GlobalParams.h>
#include <OptionalContent.h>
......@@ -28,7 +28,7 @@ for which a new license (GPL+exception) is in place.
#include <cpp/poppler-version.h>
#include <SplashOutputDev.h>
#include <splash/SplashBitmap.h>
// </include poppler>
// </poppler>
#include "importpdf.h"
#include "importpdfconfig.h"
......
......@@ -7,9 +7,9 @@ for which a new license (GPL+exception) is in place.
#ifndef IMPORTPDFCONFIG_H
#define IMPORTPDFCONFIG_H
// <include poppler>
// <poppler>
#include <cpp/poppler-version.h>
// </include poppler>
// </poppler>
#define POPPLER_VERSION_ENCODE(major, minor, micro) ( \
((major) * 10000) \
......
......@@ -7,12 +7,12 @@ for which a new license (GPL+exception) is in place.
#include "slaoutput.h"
// <include poppler>
// <poppler>
#include <GlobalParams.h>
#include <poppler-config.h>
#include <FileSpec.h>
#include <fofi/FoFiTrueType.h>
// </include poppler>
// </poppler>
#include <QApplication>
#include <QFile>
#include "commonstrings.h"
......
......@@ -28,7 +28,7 @@ for which a new license (GPL+exception) is in place.
#include "selection.h"
#include "vgradient.h"
// <include poppler>
// <poppler>
#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
#include <goo/gtypes.h>
#endif
......@@ -53,7 +53,7 @@ for which a new license (GPL+exception) is in place.
#include <splash/SplashMath.h>
#include <splash/SplashPath.h>
#include <splash/SplashGlyphBitmap.h>
// </include poppler>
// </poppler>
//------------------------------------------------------------------------
// LinkSubmitData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment