Remove dead code
[platform/core/security/libwebappenc.git] / CMakeLists.txt
1 # Copyright (c) 2016 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        CMakeLists.txt
16 # @author
17 # @brief
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("webappenc")
24
25 SET(SO_VERSION 1)
26 SET(VERSION "${SO_VERSION}.0.0")
27
28 ############################# cmake packages ##################################
29
30 INCLUDE(FindPkgConfig)
31
32 ############################# compiler flags ##################################
33
34 SET(CMAKE_C_FLAGS_PROFILING    "-g -std=c99 -O0 -pg -Wp,-U_FORTIFY_SOURCE")
35 SET(CMAKE_CXX_FLAGS_PROFILING  "-g -std=c++0x -O0 -pg -Wp,-U_FORTIFY_SOURCE")
36 SET(CMAKE_C_FLAGS_DEBUG        "-g -std=c99 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
37 SET(CMAKE_CXX_FLAGS_DEBUG      "-g -std=c++0x -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
38 SET(CMAKE_C_FLAGS_RELEASE      "-g -std=c99 -O2")
39 SET(CMAKE_CXX_FLAGS_RELEASE    "-g -std=c++0x -O2")
40 SET(CMAKE_C_FLAGS_CCOV         "-g -std=c99 -O2 --coverage")
41 SET(CMAKE_CXX_FLAGS_CCOV       "-g -std=c++0x -O2 --coverage")
42
43 # If supported for the target machine, emit position-independent code,suitable
44 # for dynamic linking and avoiding any limit on the size of the global offset
45 # table. This option makes a difference on the m68k, PowerPC and SPARC.
46 # (BJ: our ARM too?)
47 ADD_DEFINITIONS("-fPIC")
48
49 # Set compiler warning flags
50 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
51 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
52 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
53
54 STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}")
55 ADD_DEFINITIONS("-DAPI_VERSION=\"$(API_VERSION)\"")
56 ADD_DEFINITIONS("-DSMACK_ENABLED")
57 ADD_DEFINITIONS("-DSQLCIPHER_HAS_CODEC")
58 ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
59
60 # Set seed for dek_kek
61 STRING(TIMESTAMP SEED "%Y%m%d_%H:%M:%S")
62 ADD_DEFINITIONS("-DDEK_KEK_SEED=\"${SEED}\"")
63
64
65 # IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
66         ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
67         ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
68 # ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
69
70 CONFIGURE_FILE(packaging/lib${PROJECT_NAME}.manifest.in lib${PROJECT_NAME}.manifest @ONLY)
71 CONFIGURE_FILE(packaging/lib${PROJECT_NAME}-test.manifest.in lib${PROJECT_NAME}-test.manifest @ONLY)
72
73 ################# common configurations for srcs and test ######################
74 SET(DEPENDENTS "openssl1.1 dlog key-manager libtzplatform-config")
75 PKG_CHECK_MODULES(WEB_APP_ENC_DEPS
76         REQUIRED
77         ${DEPENDENTS}
78 )
79
80
81 ############################ For PC file setting  ################################
82 SET(PC_NAME lib${PROJECT_NAME})
83 SET(PC_LDFLAGS -l${PROJECT_NAME})
84 #SET(PC_CFLAGS -I\${includedir})
85
86 ############################ Target Setting ################################
87 SET(TARGET_WAE ${PROJECT_NAME})
88 SET(TARGET_WAE_INITIALIZER wae_initializer)
89 SET(TARGET_WAE_ENCRYPTER wae_encrypter)
90 SET(TARGET_WAE_TEST wae_tests)
91 SET(TARGET_WAE_TEST_COMMON wae_tests_common)
92
93 ############################ Add Sub Directories  ################################
94 ADD_SUBDIRECTORY(srcs)
95 ADD_SUBDIRECTORY(build)
96 ADD_SUBDIRECTORY(resources)
97 ADD_SUBDIRECTORY(include)
98 ADD_SUBDIRECTORY(tests)
99 ADD_SUBDIRECTORY(systemd)