CMakeLists.txt 2.75 KB
Newer Older
Bahadır Kandemir's avatar
Bahadır Kandemir committed
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
# Project name
PROJECT (comar)

# CMake 2.6 required
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

# Application name
SET (APP_NAME "comar")
SET (APP_SUFFIX "3")

# Uncomment this for production releases.
SET (VERSION_SUFFIX "")
SET (FLAGS "-g -O0 -Werror -Wcast-align -Wno-uninitialized -Wall -fstrict-aliasing")

# Uncomment this for gprof profiling
# SET (FLAGS "-g -O0 -Werror -Wcast-align -Wno-uninitialized -Wall -fstrict-aliasing -fprofile-arcs -ftest-coverage")
SET (CMAKE_C_FLAGS "${FLAGS}")
# Uncomment this for sparse building
# SET (CMAKE_C_COMPILER cgcc)

# Append name suffix, if specified
IF (APP_SUFFIX)
   SET (APP_NAME "${APP_NAME}${APP_SUFFIX}")
ENDIF (APP_SUFFIX)

# Define version, config dir, data dir and log file.
ADD_DEFINITIONS (
                 -D'PID_FILE="/var/run/${APP_NAME}.pid"'
                 -D'DATA_DIR="/var/lib/${APP_NAME}"'
                 -D'LOG_DIR="/var/log/${APP_NAME}"')

# Set standard sources
SET (SOURCES src/main.c
             src/bus.c
             src/config.c
             src/db.c
             src/iksemel.c
             src/log.c
             src/loop.c
             src/process.c
             src/policy.c
             src/pydbus.c
             src/script.c
             src/utils.c)

# Set standard libraries
SET (LIBS python2.6
Bahadır Kandemir's avatar
Bahadır Kandemir committed
48
          dbus-1)
Bahadır Kandemir's avatar
Bahadır Kandemir committed
49 50 51 52 53

# Include standard headers
INCLUDE_DIRECTORIES (include/
                     /usr/include/python2.6
                     /usr/include/dbus-1.0
Bahadır Kandemir's avatar
Bahadır Kandemir committed
54
                     /usr/lib/dbus-1.0/include)
Bahadır Kandemir's avatar
Bahadır Kandemir committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83

# Compile comar from specified sources
ADD_EXECUTABLE (comar ${SOURCES})

# Link comar to specified libraries
TARGET_LINK_LIBRARIES(comar ${LIBS} )

# Install comar to /usr/sbin/<app-name>
INSTALL (PROGRAMS comar
         DESTINATION /usr/sbin)

# Install Models
INSTALL (DIRECTORY
        models
        DESTINATION /var/db/${APP_NAME}
        PATTERN ".svn" EXCLUDE)

# Install Modules
INSTALL (DIRECTORY
        modules
        DESTINATION /var/db/${APP_NAME}
        PATTERN ".svn" EXCLUDE)

# Install service activation config under /usr/share/dbus-1/system-services/
INSTALL (FILES
         config/tr.org.pardus.comar.service
         config/tr.org.pardus.comar2.service
         DESTINATION /usr/share/dbus-1/system-services/)

Ozan Çağlayan's avatar
Ozan Çağlayan committed
84
# Install polkit policies
Bahadır Kandemir's avatar
Bahadır Kandemir committed
85
INSTALL (DIRECTORY
Ozan Çağlayan's avatar
Ozan Çağlayan committed
86 87
         policy/
         DESTINATION /usr/share/polkit-1/actions
Ozan Çağlayan's avatar
Ozan Çağlayan committed
88
         FILES_MATCHING PATTERN "*.policy"
Bahadır Kandemir's avatar
Bahadır Kandemir committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
         PATTERN ".svn" EXCLUDE)

# Install system bus policy under /etc/dbus-1/system.d/
INSTALL (FILES
         config/tr.org.pardus.comar.conf
         DESTINATION /etc/dbus-1/system.d)

# Install hav to /usr/bin/hav
INSTALL (PROGRAMS tools/hav.py
         DESTINATION /usr/bin
         RENAME hav)

# Install hav to /usr/bin/comar2to3
INSTALL (PROGRAMS tools/comar2to3.py
         DESTINATION /usr/bin
         RENAME comar2to3)