src/CMakeLists.txt
author Markus Bröker <mbroeker@largo.dyndns.tv>
Sat, 13 Dec 2008 15:41:50 +0100
changeset 20 b94039112f28
parent 15 f19c1f9b4cd3
child 23 1cd79bb84e9c
permissions -rw-r--r--
database.c and config.c were responsible for the leaks... committer: Markus Bröker <mbroeker@largo.homelinux.org>

PROJECT(mc_bot)

cmake_minimum_required(VERSION 2.4)

# Project Settings
SET(CMAKE_VERBOSE_MAKEFILE Off)
SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_C_FLAGS_RELEASE "-g -ggdb")

# C-Definitions
ADD_DEFINITIONS(-Wall -O2 -ansi -pedantic)
ADD_DEFINITIONS(-D_XOPEN_SOURCE=500)
ADD_DEFINITIONS(-DBOT_VERSION=0.95)

# Includes
INCLUDE_DIRECTORIES(../include)

# Target Definitions
ADD_EXECUTABLE(mcbot compat.c config.c database.c irc.c main.c parse.c)
ADD_EXECUTABLE(dbtool database.c dbtool.c)

# Install Rules
INSTALL(TARGETS mcbot RUNTIME DESTINATION sbin)
INSTALL(TARGETS dbtool RUNTIME DESTINATION bin)
INSTALL(DIRECTORY ../locale/ DESTINATION /var/lib/nobody/data/locale)
INSTALL(PROGRAMS ../scripts/runbot DESTINATION /etc/init.d/ 
	RENAME mcbot)

EXEC_PROGRAM(msgfmt ../locale ARGS -o de/LC_MESSAGES/mcbot.mo de/mcbot.po)

# Search required libraries
FIND_LIBRARY(GDBM_LIB NAMES gdbm
	PATHS /usr/lib/ /usr/local/lib)
IF (GDBM_LIB)
	TARGET_LINK_LIBRARIES(mcbot ${GDBM_LIB})
	TARGET_LINK_LIBRARIES(dbtool ${GDBM_LIB})
ELSE(GDBM_LIB)
	MESSAGE("YOU NEED TO INSTALL libgdbm-dev")
ENDIF (GDBM_LIB)