-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (55 loc) · 1.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# mpdgems CMakeLists.txt
# Copyright (C) 2012 Alessandro Ghedini <[email protected]>
# This file is released under the 3 clause BSD license, see COPYING
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(mpdgems C)
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 7)
INCLUDE(FindPkgConfig)
INCLUDE(CheckIncludeFiles)
PKG_CHECK_MODULES(X11 x11)
PKG_CHECK_MODULES(NOTIFY libnotify)
PKG_CHECK_MODULES(MPC REQUIRED libmpdclient)
CHECK_INCLUDE_FILES(libircclient/libircclient.h IRCCLIENT_FOUND)
INCLUDE_DIRECTORIES(
${X11_INCLUDE_DIRS}
${MPC_INCLUDE_DIRS}
${NOTIFY_INCLUDE_DIRS}
)
SET(CMAKE_C_FLAGS "-Wall")
MACRO(ADD_MPDUTIL BIN_NAME)
ADD_EXECUTABLE(${BIN_NAME} "src/${BIN_NAME}.c")
TARGET_LINK_LIBRARIES(${BIN_NAME}
${MPC_LIBRARIES} ${ARGV1}
)
INSTALL(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/${BIN_NAME}
DESTINATION bin
)
INSTALL(FILES
${PROJECT_SOURCE_DIR}/man/${BIN_NAME}.1
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
)
ENDMACRO(ADD_MPDUTIL)
IF (IRCCLIENT_FOUND)
ADD_MPDUTIL(mpdircbot "-lircclient")
ENDIF (IRCCLIENT_FOUND)
ADD_MPDUTIL(mpdislast)
ADD_MPDUTIL(mpdlength)
IF (X11_FOUND)
ADD_MPDUTIL(mpdmmkeys ${X11_LIBRARIES})
ENDIF (X11_FOUND)
ADD_MPDUTIL(mpdnextby)
IF (NOTIFY_FOUND)
ADD_MPDUTIL(mpdnotify ${NOTIFY_LIBRARIES})
ENDIF (NOTIFY_FOUND)
ADD_MPDUTIL(mpdplayby)
ADD_MPDUTIL(mpdfindby)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/CMakeUninst.txt.in
${CMAKE_CURRENT_BINARY_DIR}/CMakeUninst.txt
IMMEDIATE @ONLY
)
ADD_CUSTOM_TARGET(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMakeUninst.txt
)