0
|
1 |
PROJECT(mc_bot)
|
|
2 |
|
|
3 |
# Project Settings
|
|
4 |
SET(CMAKE_VERBOSE_MAKEFILE Off)
|
|
5 |
SET(CMAKE_BUILD_TYPE Release)
|
|
6 |
SET(CMAKE_C_FLAGS_RELEASE "-g -ggdb")
|
|
7 |
|
|
8 |
# C-Definitions
|
|
9 |
ADD_DEFINITIONS(-Wall -O2 -ansi -pedantic)
|
|
10 |
ADD_DEFINITIONS(-D_XOPEN_SOURCE=500)
|
|
11 |
ADD_DEFINITIONS(-DVERSION=0.91)
|
|
12 |
|
|
13 |
# Includes
|
|
14 |
INCLUDE_DIRECTORIES(../include)
|
|
15 |
|
|
16 |
# Target Definitions
|
|
17 |
ADD_EXECUTABLE(mcbot config.c database.c irc.c main.c parse.c)
|
|
18 |
ADD_EXECUTABLE(dbtool database.c dbtool.c)
|
|
19 |
|
|
20 |
# Install Rules
|
|
21 |
INSTALL(TARGETS mcbot RUNTIME DESTINATION sbin)
|
|
22 |
INSTALL(TARGETS dbtool RUNTIME DESTINATION bin)
|
|
23 |
INSTALL(DIRECTORY ../locale/ DESTINATION /var/lib/nobody/data/locale)
|
|
24 |
INSTALL(PROGRAMS ../scripts/runbot DESTINATION /etc/init.d/
|
|
25 |
RENAME mcbot)
|
|
26 |
|
|
27 |
EXEC_PROGRAM(msgfmt ../locale ARGS -o de/LC_MESSAGES/mcbot.mo de/mcbot.po)
|
|
28 |
|
|
29 |
# Search required libraries
|
|
30 |
FIND_LIBRARY(GDBM_LIB NAMES gdbm
|
|
31 |
PATHS /usr/lib/ /usr/local/lib)
|
|
32 |
IF (GDBM_LIB)
|
|
33 |
TARGET_LINK_LIBRARIES(mcbot ${GDBM_LIB})
|
|
34 |
TARGET_LINK_LIBRARIES(dbtool ${GDBM_LIB})
|
|
35 |
ELSE(GDBM_LIB)
|
|
36 |
MESSAGE("YOU NEED TO INSTALL libgdbm-dev")
|
|
37 |
ENDIF (GDBM_LIB)
|