mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
- convert it to use pkgconfig (so implicitely the minimum version required is 3.5.17, as first version that ships a .pc file)
- be quiet if djvu was already found svn path=/branches/work/kde4/playground/graphics/cmake/; revision=550295
This commit is contained in:
parent
15130d0454
commit
943c553bf7
|
@ -4,38 +4,47 @@
|
|||
# DJVULIBRE_FOUND - system has the DjVuLibre library
|
||||
# DJVULIBRE_INCLUDE_DIR - the DjVuLibre include directory
|
||||
# DJVULIBRE_LIBRARY - Link this to use the DjVuLibre library
|
||||
#
|
||||
include(CheckLibraryExists)
|
||||
|
||||
# reset vars
|
||||
set(DJVULIBRE_INCLUDE_DIR)
|
||||
set(DJVULIBRE_LIBRARY)
|
||||
if (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
|
||||
find_path(DJVULIBRE_INCLUDE_DIR libdjvu/ddjvuapi.h
|
||||
# in cache already
|
||||
set(DJVULIBRE_FOUND TRUE)
|
||||
|
||||
else (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
|
||||
include(UsePkgConfig)
|
||||
|
||||
pkgconfig(ddjvuapi _ddjvuIncDir _ddjvuLinkDir ddjvuLinkFlags _ddjvuCflags)
|
||||
|
||||
find_path(DJVULIBRE_INCLUDE_DIR libdjvu/ddjvuapi.h
|
||||
${_ddjvuIncDir}
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
${GNUWIN32_DIR}/include
|
||||
)
|
||||
)
|
||||
|
||||
find_library(DJVULIBRE_LIBRARY NAMES djvulibre
|
||||
find_library(DJVULIBRE_LIBRARY NAMES djvulibre
|
||||
PATHS
|
||||
${_ddjvuLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
${GNUWIN32_DIR}/lib
|
||||
)
|
||||
)
|
||||
|
||||
if(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
if(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
set(DJVULIBRE_FOUND TRUE)
|
||||
endif(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
endif(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
|
||||
if (DJVULIBRE_FOUND)
|
||||
if (DJVULIBRE_FOUND)
|
||||
if (NOT DJVULIBRE_FIND_QUIETLY)
|
||||
message(STATUS "Found DjVuLibre: ${DJVULIBRE_LIBRARY}")
|
||||
endif (NOT DJVULIBRE_FIND_QUIETLY)
|
||||
else (DJVULIBRE_FOUND)
|
||||
else (DJVULIBRE_FOUND)
|
||||
if (DJVULIBRE_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find DjVuLibre")
|
||||
endif (DJVULIBRE_FIND_REQUIRED)
|
||||
endif (DJVULIBRE_FOUND)
|
||||
endif (DJVULIBRE_FOUND)
|
||||
|
||||
mark_as_advanced(DJVULIBRE_INCLUDE_DIR DJVULIBRE_LIBRARY)
|
||||
mark_as_advanced(DJVULIBRE_INCLUDE_DIR DJVULIBRE_LIBRARY)
|
||||
|
||||
endif (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
|
||||
|
|
Loading…
Reference in a new issue