2014-11-13 01:04:59 +02:00
|
|
|
# - Try to find the Qt4 binding of the Poppler library
|
2020-02-10 20:40:01 +00:00
|
|
|
#
|
2014-11-13 01:04:59 +02:00
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# POPPLER_QT4_FOUND - system has poppler-qt4
|
|
|
|
# POPPLER_QT4_INCLUDE_DIR - the poppler-qt4 include directory
|
2020-02-19 20:52:40 +00:00
|
|
|
# POPPLER_QT4_LIBRARIES - the libraries needed to use poppler-qt4
|
|
|
|
# POPPLER_QT4_DEFINITIONS - compiler switches required for using poppler-qt4
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
2020-02-07 00:14:00 +00:00
|
|
|
# Copyright (c) 2020, Ivailo Monev, <xakepa10@gmail.com>
|
2014-11-13 01:04:59 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2020-02-07 00:14:00 +00:00
|
|
|
set(POPPLER_QT4_NAMES poppler-katie poppler-qt4)
|
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
find_package(PkgConfig)
|
|
|
|
foreach(name ${POPPLER_QT4_NAMES})
|
|
|
|
if(NOT PC_POPPLER_QT4_FOUND)
|
|
|
|
pkg_check_modules(PC_POPPLER_QT4 QUIET ${name})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
set(POPPLER_QT4_INCLUDE_DIR ${PC_POPPLER_QT4_INCLUDE_DIRS})
|
|
|
|
set(POPPLER_QT4_LIBRARIES ${PC_POPPLER_QT4_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-18 15:53:03 +00:00
|
|
|
set(POPPLER_QT4_VERSION ${PC_POPPLER_QT4_VERSION})
|
2020-02-07 00:14:00 +00:00
|
|
|
set(POPPLER_QT4_DEFINITIONS ${PC_POPPLER_QT4_CFLAGS_OTHER})
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT POPPLER_QT4_INCLUDE_DIR OR NOT POPPLER_QT4_LIBRARIES)
|
|
|
|
find_path(POPPLER_QT4_INCLUDE_DIR
|
|
|
|
NAMES poppler-katie.h poppler-qt4.h
|
|
|
|
PATH_SUFFIXES poppler/katie poppler/qt4 poppler
|
|
|
|
HINTS $ENV{POPPLERQT4DIR}/include
|
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
find_library(POPPLER_QT4_LIBRARIES
|
|
|
|
NAMES ${POPPLER_QT4_NAMES}
|
|
|
|
HINTS $ENV{POPPLERQT4DIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-07 00:14:00 +00:00
|
|
|
find_package_handle_standard_args(PopplerQt4
|
2020-02-18 15:53:03 +00:00
|
|
|
VERSION_VAR POPPLER_QT4_VERSION
|
2020-02-10 20:40:01 +00:00
|
|
|
REQUIRED_VARS POPPLER_QT4_INCLUDE_DIR POPPLER_QT4_LIBRARIES
|
2020-02-07 00:14:00 +00:00
|
|
|
)
|
2014-11-13 01:04:59 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
# for compatibility
|
2014-11-13 01:04:59 +02:00
|
|
|
set(POPPLER_QT4_FOUND ${POPPLERQT4_FOUND})
|
2020-02-10 20:40:01 +00:00
|
|
|
|
2014-11-13 01:04:59 +02:00
|
|
|
mark_as_advanced(POPPLER_QT4_INCLUDE_DIR POPPLER_QT4_LIBRARIES)
|