diff options
author | Marvin W <git@larma.de> | 2017-03-23 17:10:45 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-23 17:16:08 +0100 |
commit | e6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch) | |
tree | 54acce89355ee07b05db761d6d0dad8dad4e0f36 /cmake/FindGDKPixbuf2.cmake | |
parent | ef0483765a0fd567f25b1f0af6df04e8973e5624 (diff) | |
download | dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip |
New CMake
- add install and uninstall targets
- compatibility for systems without pkg-config
Diffstat (limited to 'cmake/FindGDKPixbuf2.cmake')
-rw-r--r-- | cmake/FindGDKPixbuf2.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/FindGDKPixbuf2.cmake b/cmake/FindGDKPixbuf2.cmake new file mode 100644 index 00000000..d100deea --- /dev/null +++ b/cmake/FindGDKPixbuf2.cmake @@ -0,0 +1,24 @@ +include(PkgConfigWithFallback) +find_pkg_config_with_fallback(GDKPixbuf2 + PKG_CONFIG_NAME gdk-pixbuf-2.0 + LIB_NAMES gdk_pixbuf-2.0 + INCLUDE_NAMES gdk-pixbuf/gdk-pixbuf.h + INCLUDE_DIR_SUFFIXES gdk-pixbuf-2.0 gdk-pixbuf-2.0/include + DEPENDS GLib +) + +if(GDKPixbuf2_FOUND AND NOT GDKPixbuf2_VERSION) + find_path(GDKPixbuf2_INCLUDE_DIR "gdk-pixbuf/gdk-pixbuf.h" HINTS ${GDKPixbuf2_INCLUDE_DIRS}) + + if(GDKPixbuf2_INCLUDE_DIR) + file(STRINGS "${GDKPixbuf2_INCLUDE_DIR}/gdk-pixbuf/gdk-pixbuf-features.h" GDKPixbuf2_VERSION REGEX "^#define GDK_PIXBUF_VERSION \\\"[^\\\"]+\\\"") + string(REGEX REPLACE "^#define GDK_PIXBUF_VERSION \\\"([0-9]+)\\.([0-9]+)\\.([0-9]+)\\\"$" "\\1.\\2.\\3" GDKPixbuf2_VERSION "${GDKPixbuf2_VERSION}") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GDKPixbuf2 + FOUND_VAR GDKPixbuf2_FOUND + REQUIRED_VARS GDKPixbuf2_LIBRARY + VERSION_VAR GDKPixbuf2_VERSION +)
\ No newline at end of file |