From 8082ea8ff3acd6a2f87f5d507472d3ba93b696d1 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 9 Oct 2006 17:54:24 +0000 Subject: [PATCH] detect if we're using poppler head svn path=/trunk/playground/graphics/cmake/modules/; revision=593974 --- cmake/modules/FindPoppler.cmake | 27 ++++++++++++++++++++++++++- config-okular.h.cmake | 2 ++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake index f6da3bf94..00eb59696 100644 --- a/cmake/modules/FindPoppler.cmake +++ b/cmake/modules/FindPoppler.cmake @@ -26,8 +26,33 @@ endif(_PopplerLinkFlags) if (POPPLER_FOUND) set(POPPLER_INCLUDE_DIR ${_PopplerIncDir}) set(POPPLER_LIBRARY ${_PopplerLinkFlags}) + + # check whether we're using poppler HEAD + set(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIR}/poppler ${QT_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${POPPLER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY}) +check_cxx_source_compiles(" +#define UNSTABLE_POPPLER_QT4 + +#include + +int main() +{ + Poppler::SoundObject * so = 0; + (void)so; + + return 0; +} +" HAVE_POPPLER_HEAD ) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + if (HAVE_POPPLER_HEAD) + set(popplerHeadMessage "yes") + else (HAVE_POPPLER_HEAD) + set(popplerHeadMessage "no") + endif (HAVE_POPPLER_HEAD) + if (NOT POPPLER_FIND_QUIETLY) - message(STATUS "Found Poppler-qt4: ${POPPLER_LIBRARY}") + message(STATUS "Found Poppler-Qt4: ${POPPLER_LIBRARY}, HEAD? ${popplerHeadMessage}") endif (NOT POPPLER_FIND_QUIETLY) else (POPPLER_FOUND) if (POPPLER_FIND_REQUIRED) diff --git a/config-okular.h.cmake b/config-okular.h.cmake index c24f414f5..86a5ddad1 100644 --- a/config-okular.h.cmake +++ b/config-okular.h.cmake @@ -1,3 +1,5 @@ /* Defines if force the use DRM in okular */ #define OKULAR_FORCE_DRM ${_OKULAR_FORCE_DRM} +/* Defined if we have the HEAD version of the Poppler library */ +#cmakedefine HAVE_POPPLER_HEAD 1