add a check to detect poppler >= 0.5.1

polish a bit CMakeList.txt and ConfigureChecks.cmake

CCMAIL: aacid@kde.org

svn path=/branches/work/kde4/playground/graphics/cmake/; revision=523221
This commit is contained in:
Pino Toscano 2006-03-27 16:56:10 +00:00
parent 7e1eb57d25
commit 2f672de5c7

View file

@ -0,0 +1,38 @@
# - Try to find the poppler PDF library
# Once done this will define
#
# POPPLER_FOUND - system has poppler
# POPPLER_INCLUDE_DIR - the poppler include directory
# POPPLER_LIBRARY - Link this to use poppler
#
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
INCLUDE(UsePkgConfig)
PKGCONFIG(poppler _PopplerIncDir _PopplerLinkDir _PopplerLinkFlags _PopplerCflags)
if(_PopplerLinkFlags)
# find again pkg-config, to query it about poppler version
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
# query pkg-config asking for a poppler >= 0.5.1
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.5.1 poppler RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
if(_return_VALUE STREQUAL "0")
set(POPPLER_FOUND TRUE)
endif(_return_VALUE STREQUAL "0")
endif(_PopplerLinkFlags)
if (POPPLER_FOUND)
set(POPPLER_INCLUDE_DIR ${_PopplerIncDir})
set(POPPLER_LIBRARY ${_PopplerLinkFlags})
if (NOT POPPLER_FIND_QUIETLY)
message(STATUS "Found Poppler: ${POPPLER_LIBRARY}")
endif (NOT POPPLER_FIND_QUIETLY)
else (POPPLER_FOUND)
if (POPPLER_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find POPPLER")
endif (POPPLER_FIND_REQUIRED)
endif (POPPLER_FOUND)
MARK_AS_ADVANCED(POPPLER_INCLUDE_DIR POPPLER_LIBRARY)