-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
68 lines (52 loc) · 1.6 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
INCLUDE(UseCMakeModules.cmake)
SET(VERSION_MAJOR 1)
SET(VERSION_MINOR 82)
SET(VERSION_PATCH "REVISION")
SET(AUTHOR "Yogin")
SET(PRODUCT "mtpchat-server")
SET(DESCRIPTION "<Mtp> chat server")
SET(TARGET "mtpchat-server")
SET(YEAR "2000-2015")
PROJECT(${PRODUCT} C CXX)
INIT_DEFAULT_OPTIONS()
SET_OPTION_DEFAULT(WITH_EXCEPTIONS OFF)
SET_OPTION_DEFAULT(WITH_RTTI OFF)
SET_OPTION_DEFAULT(WITH_INSTALL_LIBRARIES OFF)
SETUP_DEFAULT_OPTIONS()
INIT_BUILD_FLAGS()
SETUP_BUILD_FLAGS()
SETUP_PREFIX_PATHS(${TARGET})
SETUP_EXTERNAL()
IF(APPLE)
SET(DATABASE_NAME "database")
SET(HELP_PATH "help")
SET(LOG_PATH "log")
SET(MESSAGES_PATH "messages")
ELSEIF(UNIX)
SET(DATABASE_NAME "${ETC_ABSOLUTE_PREFIX}/database")
SET(HELP_PATH "${SHARE_ABSOLUTE_PREFIX}/help")
SET(LOG_PATH "/var/log/${TARGET}")
SET(MESSAGES_PATH "/var/lib/${TARGET}/messages")
ELSE(WIN32)
SET(DATABASE_NAME "database")
SET(HELP_PATH "help")
SET(LOG_PATH "log")
SET(MESSAGES_PATH "messages")
ENDIF()
GEN_CONFIG_H()
GEN_REVISION_H()
FILE(GLOB SRC src/*.c src/*.h)
SET_TARGET_CONSOLE_EXECUTABLE(${TARGET} ${SRC})
SET_TARGET_LABEL(${TARGET} ${PRODUCT})
IF(WIN32)
TARGET_LINK_LIBRARIES(${TARGET} Ws2_32)
ELSE()
TARGET_LINK_LIBRARIES(${TARGET} m crypt)
ENDIF()
# Configration file
INSTALL(FILES database DESTINATION ${ETC_PREFIX})
# Help files are not modified by application
INSTALL(DIRECTORY help DESTINATION ${SHARE_PREFIX})
# Files that are created and modified by application
INSTALL(FILES messages/Hall DESTINATION ${MESSAGES_PATH})