diff --git a/cmake/modules/FindDjVuLibre.cmake b/cmake/modules/FindDjVuLibre.cmake new file mode 100644 index 000000000..e19eb3d95 --- /dev/null +++ b/cmake/modules/FindDjVuLibre.cmake @@ -0,0 +1,52 @@ +# - Try to find the DjVuLibre library +# Once done this will define +# +# DJVULIBRE_FOUND - system has the DjVuLibre library +# DJVULIBRE_INCLUDE_DIR - the DjVuLibre include directory +# DJVULIBRE_LIBRARY - Link this to use the DjVuLibre library + +if (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY) + + # in cache already + set(DJVULIBRE_FOUND TRUE) + +else (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY) + + include(UsePkgConfig) + + pkgconfig(ddjvuapi _ddjvuIncDir _ddjvuLinkDir ddjvuLinkFlags _ddjvuCflags) + + if(_ddjvuIncDir) + find_path(DJVULIBRE_INCLUDE_DIR libdjvu/ddjvuapi.h + ${_ddjvuIncDir} + /usr/local/include + /usr/include + ${GNUWIN32_DIR}/include + ) + + find_library(DJVULIBRE_LIBRARY NAMES djvulibre + PATHS + ${_ddjvuLinkDir} + /usr/lib + /usr/local/lib + ${GNUWIN32_DIR}/lib + ) + endif(_ddjvuIncDir) + + if(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY) + set(DJVULIBRE_FOUND TRUE) + endif(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY) + + if (DJVULIBRE_FOUND) + if (NOT DjVuLibre_FIND_QUIETLY) + message(STATUS "Found DjVuLibre: ${DJVULIBRE_LIBRARY}") + endif (NOT DjVuLibre_FIND_QUIETLY) + else (DJVULIBRE_FOUND) + if (DjVuLibre_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find DjVuLibre") + endif (DjVuLibre_FIND_REQUIRED) + endif (DJVULIBRE_FOUND) + + mark_as_advanced(DJVULIBRE_INCLUDE_DIR DJVULIBRE_LIBRARY) + +endif (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY) diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake index 00eb59696..80639e0b8 100644 --- a/cmake/modules/FindPoppler.cmake +++ b/cmake/modules/FindPoppler.cmake @@ -51,13 +51,13 @@ int main() set(popplerHeadMessage "no") endif (HAVE_POPPLER_HEAD) - if (NOT POPPLER_FIND_QUIETLY) + if (NOT Poppler_FIND_QUIETLY) message(STATUS "Found Poppler-Qt4: ${POPPLER_LIBRARY}, HEAD? ${popplerHeadMessage}") - endif (NOT POPPLER_FIND_QUIETLY) + endif (NOT Poppler_FIND_QUIETLY) else (POPPLER_FOUND) - if (POPPLER_FIND_REQUIRED) + if (Poppler_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find Poppler-qt4") - endif (POPPLER_FIND_REQUIRED) + endif (Poppler_FIND_REQUIRED) endif (POPPLER_FOUND) MARK_AS_ADVANCED(POPPLER_INCLUDE_DIR POPPLER_LIBRARY)