simulatordaemon: Integrate with systemd
[platform/core/security/tef-simulator.git] / CMakeLists.txt
1 # Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 # @file
16 # @author  Lukasz Kostyra (l.kostyra@samsung.com)
17 # @brief   Main CMakeLists for tef-simulator
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("tef-simulator")
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28
29 ############################# compiler flags ##################################
30
31 # If supported for the target machine, emit position-independent code,suitable
32 # for dynamic linking and avoiding any limit on the size of the global offset
33 # table. This option makes a difference on the m68k, PowerPC and SPARC.
34 ADD_DEFINITIONS("-fPIC")
35
36 # SECOS SIM define used in the project
37 ADD_DEFINITIONS("-D_SECOS_SIM_")
38
39 # Disable std::array in boost - daemon is built around boost's implementation of array
40 ADD_DEFINITIONS("-DBOOST_ASIO_DISABLE_STD_ARRAY")
41
42 ADD_DEFINITIONS("-D_GNU_SOURCE")
43
44 # Set compiler warning flags
45 # TODO uncomment these when it's cleanup time
46 #ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
47 #ADD_DEFINITIONS("-Wall")                        # Generate all warnings
48 #ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
49
50
51 IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
52     ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
53     ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
54     ADD_DEFINITIONS("-ggdb -O0")
55     # undefine _FORTIFY_SOURCE - it makes no sense without optimization and produces warnings
56     ADD_DEFINITIONS("-Wp,-U_FORTIFY_SOURCE")
57     ADD_DEFINITIONS("-D_LOGGING")
58 ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
59
60 ############################# targets #########################################
61
62 SET(TARGET_TEF_SIMULATOR tef-simulator)
63 SET(TARGET_TEF_SIMULATOR_LOG ${TARGET_TEF_SIMULATOR}-log)
64 SET(TARGET_TEF_SIMULATOR_OSAL ${TARGET_TEF_SIMULATOR}-osal)
65 SET(TARGET_TEF_SIMULATOR_DAEMON ${TARGET_TEF_SIMULATOR}-daemon)
66 SET(TARGET_TEF_SIMULATOR_SSFLIB ${TARGET_TEF_SIMULATOR}-ssflib)
67
68 # below targets need different names due to linking with CAs and TAs (libteec for client)
69 SET(TARGET_TEF_SIMULATOR_TEEC_LIB teec)
70 SET(TARGET_TEF_SIMULATOR_TEE_STUB TEEStub)
71
72 ############################# sub-project paths ###############################
73
74 # project root
75 SET(TEF_SIMULATOR_ROOT_PATH ${PROJECT_SOURCE_DIR})
76 SET(TEF_SIMULATOR_INCLUDE_PATH ${TEF_SIMULATOR_ROOT_PATH}/include)
77
78 # log
79 SET(LOG_PATH ${TEF_SIMULATOR_ROOT_PATH}/log)
80
81 # osal
82 SET(OSAL_PATH ${TEF_SIMULATOR_ROOT_PATH}/osal)
83
84 # PackageMaker
85 SET(PACKAGE_MAKER_PATH ${TEF_SIMULATOR_ROOT_PATH}/PackageMaker)
86
87 # ssflib
88 SET(SSFLIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/ssflib)
89 SET(SSFLIB_DEP_PATH ${SSFLIB_PATH}/dep)
90 SET(SSFLIB_DEP_CRYPTOCORE_PATH ${SSFLIB_DEP_PATH}/cryptocore)
91 SET(SSFLIB_DEP_SWDSS_PATH ${SSFLIB_DEP_PATH}/swdss)
92 SET(SSFLIB_DEP_TIME_PATH ${SSFLIB_DEP_PATH}/time)
93 SET(SSFLIB_DEP_UCI_PATH ${SSFLIB_DEP_PATH}/uci)
94
95 # simulatordaemon
96 SET(DAEMON_PATH ${TEF_SIMULATOR_ROOT_PATH}/simulatordaemon)
97
98 # TEECLib
99 SET(TEEC_LIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEECLib)
100
101 # TEEStub
102 SET(TEE_STUB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEEStub)
103
104 ############################# subdirectories ##################################
105
106 ADD_SUBDIRECTORY(cmake)
107 ADD_SUBDIRECTORY(log)
108 ADD_SUBDIRECTORY(osal)
109 ADD_SUBDIRECTORY(PackageMaker)
110 ADD_SUBDIRECTORY(pkgconfig)
111 ADD_SUBDIRECTORY(simulatordaemon)
112 ADD_SUBDIRECTORY(ssflib)
113 ADD_SUBDIRECTORY(systemd)
114 ADD_SUBDIRECTORY(TEECLib)
115 ADD_SUBDIRECTORY(TEEStub)