# - Try to find Poppler and Poppler-Qt4 # Once done this will define # # POPPLER_FOUND - system has Poppler and Poppler-Qt4 # POPPLER_NEEDS_FONTCONFIG - A boolean indicating if libpoppler depend-cpp and Poppler-Qt4 # # # Redistribution and use of this file is allowed according to the terms of the # MIT license. For details see the file COPYING-CMAKE-MODULES. if ( POPPLER_LIBRARIES ) # in cache already SET(Poppler_FIND_QUIETLY TRUE) endif ( POPPLER_LIBRARIES ) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls if( NOT WIN32 ) find_package(PkgConfig) pkg_check_modules(POPPLER_CPP QUIET poppler-cpp) endif( NOT WIN32 ) # Find libpoppler-cpp and associated header files (Required) FIND_LIBRARY(POPPLER_LIBRARIES NAMES poppler-cpp ${POPPLER_CPP_LIBRARIES} PATHS /usr/local /usr HINTS ${POPPLER_CPP_LIBRARY_DIRS} # Generated by pkg-config PATH_SUFFIXES lib64 lib ) IF ( NOT(POPPLER_LIBRARIES) ) MESSAGE(STATUS "Could not find libpoppler-cpp." ) ENDIF () # Scan poppler libraries for dependencies on Fontconfig INCLUDE(GetPrerequisites) MARK_AS_ADVANCED(gp_cmd) GET_PREREQUISITES("${POPPLER_LIBRARIES}" POPPLER_PREREQS TRUE FALSE "" "") IF ("${POPPLER_PREREQS}" MATCHES "fontconfig") SET(POPPLER_NEEDS_FONTCONFIG TRUE) ELSE () SET(POPPLER_NEEDS_FONTCONFIG FALSE) ENDIF () include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Poppler DEFAULT_MSG POPPLER_LIBRARIES ) # show the POPPLER_(XPDF/QT4)_INCLUDE_DIR and POPPLER_LIBRARIES variables only in the advanced view MARK_AS_ADVANCED(POPPLER_LIBRARIES)