2022-04-17 04:05:30 +03:00
|
|
|
# Try to find Poppler library, once done this will define:
|
|
|
|
#
|
|
|
|
# POPPLER_FOUND - system has Poppler
|
|
|
|
# POPPLER_INCLUDE_DIR - the Poppler include directory
|
|
|
|
# POPPLER_LIBRARIES - the libraries needed to use Poppler
|
|
|
|
#
|
2022-04-17 21:22:19 +03:00
|
|
|
# Copyright (c) 2022 Ivailo Monev <xakepa10@gmail.com>
|
2022-04-17 04:05:30 +03:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(PC_POPPLER QUIET poppler-cpp)
|
2022-04-17 04:05:30 +03:00
|
|
|
|
2022-10-02 10:46:46 +03:00
|
|
|
set(POPPLER_INCLUDE_DIR ${PC_POPPLER_INCLUDE_DIRS})
|
|
|
|
set(POPPLER_LIBRARIES ${PC_POPPLER_LIBRARIES})
|
2022-04-17 04:05:30 +03:00
|
|
|
set(POPPLER_VERSION ${PC_POPPLER_VERSION})
|
|
|
|
|
|
|
|
if(NOT POPPLER_INCLUDE_DIR OR NOT POPPLER_LIBRARIES)
|
|
|
|
find_path(POPPLER_INCLUDE_DIR
|
|
|
|
NAMES poppler/cpp/poppler-document.h
|
|
|
|
HINTS $ENV{POPPLERDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(POPPLER_LIBRARIES
|
|
|
|
NAMES poppler-cpp
|
|
|
|
HINTS $ENV{POPPLERDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Poppler
|
|
|
|
VERSION_VAR POPPLER_VERSION
|
|
|
|
REQUIRED_VARS POPPLER_LIBRARIES POPPLER_INCLUDE_DIR
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(POPPLER_INCLUDE_DIR POPPLER_LIBRARIES)
|