summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: ea9a5993035c91a543b80c9b592505b75ccd88ff (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#
# @file        CMakeLists.txt
# @author      Kyungwook Tak (k.tak@samsung.com)
# @brief       csr-framework project cmake file on the top
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(${SERVICE_NAME})

INCLUDE(FindPkgConfig)

SET(CMAKE_C_FLAGS_PROFILING    "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
SET(CMAKE_CXX_FLAGS_PROFILING  "-g -std=c++0x -O0 -pg -Wp,-U_FORTIFY_SOURCE")
SET(CMAKE_C_FLAGS_DEBUG        "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
SET(CMAKE_CXX_FLAGS_DEBUG      "-g -std=c++0x -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
SET(CMAKE_C_FLAGS_RELEASE      "-g -O2 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELEASE    "-g -std=c++0x -O2 -DNDEBUG")
SET(CMAKE_C_FLAGS_CCOV         "-g -O2 --coverage")
SET(CMAKE_CXX_FLAGS_CCOV       "-g -std=c++0x -O2 --coverage")

ADD_DEFINITIONS("-fPIC")
ADD_DEFINITIONS("-Werror")
ADD_DEFINITIONS("-Wall")
ADD_DEFINITIONS("-Wextra")

STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}")
ADD_DEFINITIONS("-DSERVICE_NAME=\"${SERVICE_NAME}\"")
ADD_DEFINITIONS("-DSMACK_DOMAIN_NAME=\"${SMACK_DOMAIN_NAME}\"")
ADD_DEFINITIONS("-DINCLUDE_INSTALL_DIR=\"${INCLUDE_INSTALL_DIR}\"")
ADD_DEFINITIONS("-DBIN_DIR=\"${BIN_DIR}\"")
ADD_DEFINITIONS("-DRO_DBSPACE=\"${RO_DBSPACE}\"")
ADD_DEFINITIONS("-DRW_DBSPACE=\"${RW_DBSPACE}\"")
ADD_DEFINITIONS("-DSERVICE_IDLE_TIMEOUT_TIME=${SERVICE_IDLE_TIMEOUT_TIME}")
ADD_DEFINITIONS("-DPOPUP_SERVICE_IDLE_TIMEOUT_TIME=${POPUP_SERVICE_IDLE_TIMEOUT_TIME}")
ADD_DEFINITIONS("-DPOPUP_SERVICE_ENV_FILE_PATH=\"${POPUP_SERVICE_ENV_FILE_PATH}\"")
ADD_DEFINITIONS("-DENGINE_RW_WORKING_DIR=\"${ENGINE_RW_WORKING_DIR}\"")
ADD_DEFINITIONS("-DENGINE_DIR=\"${ENGINE_DIR}\"")
ADD_DEFINITIONS("-DTEST_DIR=\"${TEST_DIR}\"")
ADD_DEFINITIONS("-DTEST_RES_DIR=\"${TEST_RES_DIR}\"")
ADD_DEFINITIONS("-DDEFAULT_ICON_PATH=\"${RO_RES_DIR}/default-icon.png\"")

IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
	ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
	ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")

IF (BUILD_GCOV)
	ADD_DEFINITIONS("-DTIZEN_TEST_GCOV")
ENDIF (BUILD_GCOV)

SET(TARGET_CSR_SERVER ${SERVICE_NAME}-server)
SET(TARGET_CSR_CLIENT ${SERVICE_NAME}-client)
SET(TARGET_CSR_COMMON ${SERVICE_NAME}-common)
SET(TARGET_CSR_POPUP ${SERVICE_NAME}-popup)
SET(TARGET_CSR_TEST ${SERVICE_NAME}-test)
SET(TARGET_CSR_TEST_COMMON ${SERVICE_NAME}-test-common)
SET(TARGET_CSR_INTERNAL_TEST ${SERVICE_NAME}-internal-test)
SET(TARGET_CSR_POPUP_TEST ${SERVICE_NAME}-popup-test)
SET(TARGET_CSR_THREADPOOL_TEST ${SERVICE_NAME}-threadpool-test)

SET(TARGET_CSR_CS_ENGINE ${SERVICE_NAME}-cs-engine)
SET(TARGET_CSR_WP_ENGINE ${SERVICE_NAME}-wp-engine)
ADD_DEFINITIONS("-DCS_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_CS_ENGINE}.so\"")
ADD_DEFINITIONS("-DWP_ENGINE_PATH=\"${ENGINE_DIR}/lib${TARGET_CSR_WP_ENGINE}.so\"")

SET(LOCALEDIR "${RO_DATA_DIR}/locale")

CONFIGURE_FILE(packaging/${SERVICE_NAME}-client.manifest.in ${SERVICE_NAME}-client.manifest @ONLY)
CONFIGURE_FILE(packaging/${SERVICE_NAME}-common.manifest.in ${SERVICE_NAME}-common.manifest @ONLY)

ADD_DEFINITIONS("-DTZ_SYS_STORAGE=\"${TZ_SYS_STORAGE}\"")
ADD_DEFINITIONS("-DTZ_SYS_RW_APP=\"${TZ_SYS_RW_APP}\"")
ADD_DEFINITIONS("-DTZ_SYS_RO_APP=\"${TZ_SYS_RO_APP}\"")

CONFIGURE_FILE(packaging/${SERVICE_NAME}.manifest.in ${SERVICE_NAME}.manifest @ONLY)
CONFIGURE_FILE(packaging/${SERVICE_NAME}-test.manifest.in ${SERVICE_NAME}-test.manifest @ONLY)

IF (DEFINED DETAILED_URL_BASE)
	MESSAGE("Use base of detailed url: ${DETAILED_URL_BASE}")
	ADD_DEFINITIONS("-DDETAILED_URL_BASE=\"${DETAILED_URL_BASE}\"")
ENDIF (DEFINED DETAILED_URL_BASE)

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(pkgconfig)
ADD_SUBDIRECTORY(systemd)
ADD_SUBDIRECTORY(test)