1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
6 STRING(REGEX MATCH "([^.]*)" SO_VERSION "${VERSION}")
9 SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections")
10 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GC_SECTIONS_FLAGS}")
11 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GC_SECTIONS_FLAGS}")
12 SET(CMAKE_C_FLAGS_RELEASE "-g -O2")
13 SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++0x -O2")
14 SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wp,-U_FORTIFY_SOURCE")
15 SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++0x -O0 -Wp,-U_FORTIFY_SOURCE")
16 SET(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage")
17 SET(CMAKE_CXX_FLAGS_CCOV "-g -std=c++0x -O2 --coverage")
18 SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
19 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
20 SET(CMAKE_SKIP_RPATH "TRUE")
22 # compiler warning flags
23 ADD_DEFINITIONS("-Wall")
24 ADD_DEFINITIONS("-Wextra")
25 ADD_DEFINITIONS("-Werror")
27 SET(TARGET_VCORE_LIB "cert-svc-vcore")
28 SET(TARGET_CERT_SERVER "cert-server")
30 ADD_DEFINITIONS("-DSIGNATURE_SCHEMA_PATH=\"${CERT_SVC_RO_PATH}/schema.xsd\"")
32 ADD_DEFINITIONS("-DSERVER_STREAM=\"${SERVER_STREAM}\"")
34 ADD_DEFINITIONS("-DCERTSVC_SYSTEM_STORE_DB=\"${CERT_SVC_DB_PATH}/certs-meta.db\"")
35 ADD_DEFINITIONS("-DCERTSVC_PKCS12_STORAGE_DIR=\"${CERT_SVC_PKCS12}/\"")
37 ADD_DEFINITIONS("-DTZ_SYS_CA_CERTS=\"${TZ_SYS_CA_CERTS}\"")
38 ADD_DEFINITIONS("-DTZ_SYS_CA_CERTS_ORIG=\"${TZ_SYS_CA_CERTS_ORIG}\"")
39 ADD_DEFINITIONS("-DTZ_SYS_CA_BUNDLE=\"${TZ_SYS_CA_BUNDLE}\"")
40 ADD_DEFINITIONS("-DTZ_SYS_RO_CA_CERTS=\"${TZ_SYS_RO_CA_CERTS}\"")
41 ADD_DEFINITIONS("-DTZ_SYS_RO_CA_BUNDLE=\"${TZ_SYS_RO_CA_BUNDLE}\"")
43 SET(CA_CERTS_PATH ${RO_DATA_DIR}/ca-certificates)
44 ADD_DEFINITIONS("-DTZ_SYS_CA_CERTS_TIZEN=\"${CA_CERTS_PATH}/tizen\"")
45 ADD_DEFINITIONS("-DFINGERPRINT_LIST_PATH=\"${CA_CERTS_PATH}/fingerprint/fingerprint_list.xml\"")
46 ADD_DEFINITIONS("-DFINGERPRINT_LIST_EXT_PATH=\"${CA_CERTS_PATH}/fingerprint/fingerprint_list_ext.xml\"")
47 ADD_DEFINITIONS("-DFINGERPRINT_LIST_RW_PATH=\"${FINGERPRINT_LIST_RW_PATH}\"")
48 ADD_DEFINITIONS("-DFINGERPRINT_LIST_SCHEMA_PATH=\"${CA_CERTS_PATH}/fingerprint/fingerprint_list.xsd\"")
50 CONFIGURE_FILE(cert-svc-vcore.pc.in cert-svc-vcore.pc @ONLY)
52 ${CMAKE_CURRENT_BINARY_DIR}/cert-svc-vcore.pc
53 DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
57 ADD_SUBDIRECTORY(systemd)
60 IF (DEFINED CERTSVC_TEST_BUILD)
61 ADD_DEFINITIONS("-DTESTAPP_RES_DIR=\"${CERT_SVC_TESTS}/\"")
62 ADD_SUBDIRECTORY(tests)
63 ADD_SUBDIRECTORY(examples)
64 ENDIF (DEFINED CERTSVC_TEST_BUILD)
66 CONFIGURE_FILE(packaging/cert-svc.manifest.in cert-svc.manifest @ONLY)