|
|
|
@ -8,43 +8,36 @@
|
|
|
|
|
# Define GDK_PIXBUF_MIN_VERSION for which version desired.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
INCLUDE(FindPkgConfig)
|
|
|
|
|
find_package(PkgConfig)
|
|
|
|
|
|
|
|
|
|
IF(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
SET(_pkgconfig_REQUIRED "REQUIRED")
|
|
|
|
|
ELSE(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
SET(_pkgconfig_REQUIRED "")
|
|
|
|
|
ENDIF(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
if(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
set(_pkgconfig_REQUIRED "REQUIRED")
|
|
|
|
|
else(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
set(_pkgconfig_REQUIRED "")
|
|
|
|
|
endif(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
|
|
|
|
|
IF(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}")
|
|
|
|
|
ELSE(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
PKG_SEARCH_MODULE(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0")
|
|
|
|
|
ENDIF(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
if(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0>=${GDK_PIXBUF_MIN_VERSION}")
|
|
|
|
|
else(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
pkg_check_modules(GDK_PIXBUF ${_pkgconfig_REQUIRED} "gdk-pixbuf-2.0")
|
|
|
|
|
endif(GDK_PIXBUF_MIN_VERSION)
|
|
|
|
|
|
|
|
|
|
IF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
FIND_PATH(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h)
|
|
|
|
|
FIND_LIBRARY(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0)
|
|
|
|
|
|
|
|
|
|
# Report results
|
|
|
|
|
IF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|
SET(GDK_PIXBUF_FOUND 1)
|
|
|
|
|
SET(GdkPixbuf_FOUND 1)
|
|
|
|
|
IF(NOT GdkPixbuf_FIND_QUIETLY)
|
|
|
|
|
MESSAGE(STATUS "Found GdkPixbuf: ${GDK_PIXBUF_LIBRARIES}")
|
|
|
|
|
ENDIF(NOT GdkPixbuf_FIND_QUIETLY)
|
|
|
|
|
ELSE(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|
IF(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
MESSAGE(SEND_ERROR "Could not find GdkPixbuf")
|
|
|
|
|
ELSE(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
IF(NOT GdkPixbuf_FIND_QUIETLY)
|
|
|
|
|
MESSAGE(STATUS "Could not find GdkPixbuf")
|
|
|
|
|
ENDIF(NOT GdkPixbuf_FIND_QUIETLY)
|
|
|
|
|
ENDIF(GdkPixbuf_FIND_REQUIRED)
|
|
|
|
|
ENDIF(GDK_PIXBUF_LIBRARIES AND GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|
ELSE(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
if(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
find_path(GDK_PIXBUF_INCLUDE_DIRS gdk-pixbuf/gdk-pixbuf.h)
|
|
|
|
|
find_library(GDK_PIXBUF_LIBRARIES gdk_pixbuf-2.0)
|
|
|
|
|
else(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
SET(GdkPixbuf_FOUND 1)
|
|
|
|
|
ENDIF(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
# Make paths absolute https://stackoverflow.com/a/35476270
|
|
|
|
|
# Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path
|
|
|
|
|
set(GDK_PIXBUF_LIBS_ABSOLUTE)
|
|
|
|
|
foreach(lib ${GDK_PIXBUF_LIBRARIES})
|
|
|
|
|
set(var_name GDK_PIXBUF_${lib}_ABS)
|
|
|
|
|
find_library(${var_name} ${lib} ${GDK_PIXBUF_LIBRARY_DIRS})
|
|
|
|
|
list(APPEND GDK_PIXBUF_LIBS_ABSOLUTE ${${var_name}})
|
|
|
|
|
endforeach()
|
|
|
|
|
set(GDK_PIXBUF_LIBRARIES ${GDK_PIXBUF_LIBS_ABSOLUTE})
|
|
|
|
|
endif(NOT GDK_PIXBUF_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
|
|
|
|
|
|
# Hide advanced variables from CMake GUIs
|
|
|
|
|
MARK_AS_ADVANCED(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
find_package_handle_standard_args(GDK_PIXBUF DEFAULT_MSG GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|
mark_as_advanced(GDK_PIXBUF_LIBRARIES GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
|