diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake index 35ac2bafa..5b5fb6a21 100644 --- a/cmake/modules/FindPoppler.cmake +++ b/cmake/modules/FindPoppler.cmake @@ -33,10 +33,22 @@ if(_PopplerLinkFlags) if(_return_VALUE STREQUAL "0") set(POPPLER_FOUND TRUE) endif(_return_VALUE STREQUAL "0") +else(_PopplerLinkFlags) + # try to find poppler without pkgconfig + find_library( LIBPOPPLER poppler ) + find_library( LIBPOPPLER_QT4 poppler-qt4 ) + find_path( INCLUDEPOPPLERQT4 qt4/poppler-qt4.h ) + find_path( INCLUDEPOPPLER poppler-qt4.h PATHS ${INCLUDEPOPPLERQT4}/qt4 ) + if( LIBPOPPLER_QT4 AND LIBPOPPLER AND INCLUDEPOPPLER ) + set( POPPLER_FOUND TRUE ) + endif( LIBPOPPLER_QT4 AND LIBPOPPLER AND INCLUDEPOPPLER ) endif(_PopplerLinkFlags) if (POPPLER_FOUND) set(POPPLER_LIBRARY ${_PopplerLinkFlags}) + if( LIBPOPPLER AND LIBPOPPLER_QT4 ) + set( POPPLER_LIBRARY ${LIBPOPPLER} ${LIBPOPPLER_QT4} ) + endif( LIBPOPPLER AND LIBPOPPLER_QT4 ) # the cflags for poppler-qt4 can contain more than one include path separate_arguments(_PopplerCflags) @@ -44,6 +56,9 @@ if (POPPLER_FOUND) string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}") set(POPPLER_INCLUDE_DIR ${POPPLER_INCLUDE_DIR} ${_includedir}) endforeach(_includedir) + if( INCLUDEPOPPLER ) + set( POPPLER_INCLUDE_DIR ${INCLUDEPOPPLER} ) + endif( INCLUDEPOPPLER ) # check whether we're using poppler 0.6 set(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIR} ${QT_INCLUDE_DIR})