Imported Debian patch 1.2.3-1~0
[ympd-debian.git] / cmake / FindLibMPDClient.cmake
1 # - Try to find LibMPDClient
2 # Once done, this will define
3 #
4 #   LIBMPDCLIENT_FOUND - System has LibMPDClient
5 #   LIBMPDCLIENT_INCLUDE_DIRS - The LibMPDClient include directories
6 #   LIBMPDCLIENT_LIBRARIES - The libraries needed to use LibMPDClient
7 #   LIBMPDCLIENT_DEFINITIONS - Compiler switches required for using LibMPDClient
8
9 find_package(PkgConfig)
10 pkg_check_modules(PC_LIBMPDCLIENT QUIET libmpdclient)
11 set(LIBMPDCLIENT_DEFINITIONS ${PC_LIBMPDCLIENT_CFLAGS_OTHER})
12
13 find_path(LIBMPDCLIENT_INCLUDE_DIR
14     NAMES mpd/player.h
15     HINTS ${PC_LIBMPDCLIENT_INCLUDEDIR} ${PC_LIBMPDCLIENT_INCLUDE_DIRS}
16 )
17
18 find_library(LIBMPDCLIENT_LIBRARY
19     NAMES mpdclient
20     HINTS ${PC_LIBMPDCLIENT_LIBDIR} ${PC_LIBMPDCLIENT_LIBRARY_DIRS}
21 )
22
23 set(LIBMPDCLIENT_LIBRARIES ${LIBMPDCLIENT_LIBRARY})
24 set(LIBMPDCLIENT_INCLUDE_DIRS ${LIBMPDCLIENT_INCLUDE_DIR})
25
26 include(FindPackageHandleStandardArgs)
27 find_package_handle_standard_args(LibMPDClient DEFAULT_MSG
28     LIBMPDCLIENT_LIBRARY LIBMPDCLIENT_INCLUDE_DIR
29 )
30
31 mark_as_advanced(LIBMPDCLIENT_LIBRARY LIBMPDCLIENT_INCLUDE_DIR)
32