Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Make gdkpixbuf & libimobiledevice optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hatstand committed Jul 21, 2015
1 parent 133e812 commit b358e21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0012 NEW)

include(CheckIncludeFiles)
include(FindPkgConfig)
Expand Down Expand Up @@ -34,10 +35,15 @@ set(SOURCES
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(LIBIMOBILEDEVICE libimobiledevice-1.0)
pkg_check_modules(GDK_PIXBUF gdk-pixbuf-2.0)

check_include_files(unistd.h HAVE_UNISTD_H)

set(HAVE_GDKPIXBUF ${GDK_PIXBUF_FOUND})
option(ENABLE_GDKPIXBUF
"Whether to include gdk-pixbuf support" ${GDK_PIXBUF_FOUND})
option(ENABLE_LIBIMOBILEDEVICE
"Whether to include libimobiledevice support" ${LIBIMOBILEDEVICE_FOUND})

set(HAVE_GDKPIXBUF ${ENABLE_GDKPIXBUF})
set(HAVE_LIBIMOBILEDEVICE ${ENABLE_LIBIMOBILEDEVICE})

set(WITH_INTERNAL_GCHECKSUM 0)
set(LIBGPOD_BLOB_DIR "${CMAKE_INSTALL_PREFIX}/libgpod")
Expand All @@ -64,6 +70,14 @@ target_link_libraries(gpod
${LIBIMOBILEDEVICE_LIBRARIES}
)

if (${HAVE_LIBIMOBILEDEVICE})
target_link_libraries(gpod ${LIBIMOBILEDEVICE_LIBRARIES})
endif ()

if (${HAVE_GDKPIXBUF})
target_link_libraries(gpod ${GDK_PIXBUF_LIBRARIES})
endif ()

install(TARGETS gpod
LIBRARY DESTINATION lib
)
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CONFIG_H

#cmakedefine HAVE_GDKPIXBUF
#cmakedefine HAVE_LIBIMOBILEDEVICE
#cmakedefine HAVE_UNISTD_H
#cmakedefine WITH_INTERNAL_GCHECKSUM

Expand Down

0 comments on commit b358e21

Please sign in to comment.