src/CMakeLists.txt
author Markus Bröker <mbroeker@largo.dyndns.tv>
Thu, 18 Nov 2010 23:32:58 +0100
changeset 60 67a32e9d95f2
parent 56 99f85cd9b310
child 62 2d6419d6d4ed
permissions -rw-r--r--
proper includes for getaddrinfo committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
PROJECT(mc_bot)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
5
7c7fc8906920 FreeBSD Stream Handling added and debian control files improved
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 4
diff changeset
     3
cmake_minimum_required(VERSION 2.4)
7c7fc8906920 FreeBSD Stream Handling added and debian control files improved
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 4
diff changeset
     4
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
# Project Settings
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
SET(CMAKE_VERBOSE_MAKEFILE Off)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
SET(CMAKE_BUILD_TYPE Release)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
SET(CMAKE_C_FLAGS_RELEASE "-g -ggdb")
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
# C-Definitions
33
56571d34d754 safe buffers, a memory leak and cleanups
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 31
diff changeset
    11
ADD_DEFINITIONS(-Wall -O2 -ansi)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
ADD_DEFINITIONS(-D_XOPEN_SOURCE=500)
33
56571d34d754 safe buffers, a memory leak and cleanups
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 31
diff changeset
    13
ADD_DEFINITIONS(-DBOT_VERSION=0.99)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
# Includes
53
ec1eec96e433 Compatibility: use default prefix and std make switches
Markus Bröker <mbroeker@volpe.spectre.org>
parents: 52
diff changeset
    16
INCLUDE_DIRECTORIES(../include /usr/local/include)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
# Target Definitions
13
d3554afaa768 mcbot-0.94-5 Changelog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 5
diff changeset
    19
ADD_EXECUTABLE(mcbot compat.c config.c database.c irc.c main.c parse.c)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
ADD_EXECUTABLE(dbtool database.c dbtool.c)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
# Install Rules
56
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    23
INSTALL(TARGETS mcbot RUNTIME DESTINATION /usr/sbin)
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    24
INSTALL(TARGETS dbtool RUNTIME DESTINATION /usr/bin)
31
bbcb8a3366b4 mcbot needs a proper system account
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 26
diff changeset
    25
INSTALL(DIRECTORY ../locale/ DESTINATION /var/lib/mcbot/data/locale)
56
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    26
INSTALL(PROGRAMS ../scripts/runbot DESTINATION /etc/init.d/ RENAME mcbot)
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    27
INSTALL(PROGRAMS ../scripts/mcbot.cgi DESTINATION /usr/lib/cgi-bin/)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    28
25
a0fad312ea30 Build dependencies improved
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 24
diff changeset
    29
# Search required programs
24
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    30
FIND_PROGRAM(MSGFMT_PROG msgfmt)
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    31
IF (MSGFMT_PROG)
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    32
    EXEC_PROGRAM(${MSGFMT_PROG} ../locale ARGS -o de/LC_MESSAGES/mcbot.mo de/mcbot.po)
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    33
ELSE(MSGFMT_PROG)
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    34
	MESSAGE(FATAL_ERROR "YOU NEED TO INSTALL gettext")
33
56571d34d754 safe buffers, a memory leak and cleanups
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 31
diff changeset
    35
ENDIF (MSGFMT_PROG)
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    36
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    37
# Search required libraries
56
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    38
#
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    39
# freebsd needs it, debian hates it
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    40
#FIND_LIBRARY(GETTEXT_LIB NAMES gettextlib
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    41
#	PATHS /usr/lib/ /usr/local/lib)
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    42
#IF (GETTEXT_LIB)
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    43
#	TARGET_LINK_LIBRARIES(mcbot ${GETTEXT_LIB})
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    44
#	TARGET_LINK_LIBRARIES(dbtool ${GETTEXT_LIB})
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    45
#ELSE(GETTEXT_LIB)
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    46
#	MESSAGE(FATAL_ERROR "YOU NEED TO INSTALL gettext")
99f85cd9b310 fixed an install error in the current build
Markus Brökers <mbroeker@largo.homelinux.org>
parents: 53
diff changeset
    47
#ENDIF (GETTEXT_LIB)
52
c9401e6a62cb Compatibility to other distributions...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 33
diff changeset
    48
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    49
FIND_LIBRARY(GDBM_LIB NAMES gdbm
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    50
	PATHS /usr/lib/ /usr/local/lib)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    51
IF (GDBM_LIB)
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    52
	TARGET_LINK_LIBRARIES(mcbot ${GDBM_LIB})
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    53
	TARGET_LINK_LIBRARIES(dbtool ${GDBM_LIB})
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    54
ELSE(GDBM_LIB)
24
f68808ae40b9 Better checks for msgfmt and libgdbm-dev added
Markus Bröker <mbroeker@largo.dyndns.tv>
parents: 23
diff changeset
    55
	MESSAGE(FATAL_ERROR "YOU NEED TO INSTALL libgdbm-dev")
0
586472add385 Initial Layout
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    56
ENDIF (GDBM_LIB)