Release version 0.64.14
[platform/core/appfw/aul-1.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2
3 PROJECT(aul)
4
5 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
6 SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
7 SET(LIBDIR ${LIB_INSTALL_DIR})
8 SET(INCLUDEDIR "\${prefix}/include")
9 SET(EXEC_PREFIX "\${prefix}")
10
11 ADD_DEFINITIONS("-DSHARE_PREFIX=\"${SHARE_INSTALL_PREFIX}/aul\"")
12
13 ADD_DEFINITIONS("-DAPPSVC_DB_VERSION=\"${APPSVC_DB_VERSION}\"")
14 ADD_DEFINITIONS("-DCOMPONENT_DB_VERSION=\"${COMPONENT_DB_VERSION}\"")
15 ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
16
17 ## Compile flags
18 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-zdefs")
19 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
20 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
21 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
22 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
23 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic")
24 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
25 SET(CMAKE_C_FLAGS_RELEASE "-O2")
26
27 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS} -std=c++17")
28 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
29 SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
30
31 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
32
33 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
34   "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
35
36 ## Target
37 SET(TARGET_AUL "aul")
38 SET(TARGET_AUL_SERVER "aul-server")
39 SET(TARGET_AUL_BLINK "aul-blink")
40
41 ENABLE_TESTING()
42 SET(TARGET_AUL_UNIT_TESTS "aul-unit-tests")
43 SET(TARGET_APP_CONTROL_TESTS "app-control-tests")
44
45 INCLUDE(FindPkgConfig)
46 INCLUDE(ApplyPkgConfig)
47
48 PKG_CHECK_MODULES(BUNDLE_DEPS REQUIRED bundle)
49 PKG_CHECK_MODULES(CAPI_SYSTEM_INFO_DEPS REQUIRED capi-system-info)
50 PKG_CHECK_MODULES(CAPI_SYSTEM_RESOURCE_DEPS REQUIRED capi-system-resource)
51 PKG_CHECK_MODULES(DLOG_DEPS REQUIRED dlog)
52 PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0)
53 PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
54 PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
55 PKG_CHECK_MODULES(LIBSMACK_DEPS REQUIRED libsmack)
56 PKG_CHECK_MODULES(LIBTZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config)
57 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
58 PKG_CHECK_MODULES(PARCEL_DEPS REQUIRED parcel)
59 PKG_CHECK_MODULES(PKGMGR_INFO_DEPS REQUIRED pkgmgr-info)
60 PKG_CHECK_MODULES(SQLITE3_DEPS REQUIRED sqlite3)
61 PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace)
62 PKG_CHECK_MODULES(UUID_DEPS REQUIRED uuid)
63 PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
64 PKG_CHECK_MODULES(XDGMIME_DEPS REQUIRED xdgmime)
65
66 # pkgconfig file
67 CONFIGURE_FILE(feature/preexec_list.txt.in
68   feature/preexec_list.txt @ONLY)
69 CONFIGURE_FILE(data/appsvc_db.sql.in
70   data/appsvc_db.sql @ONLY)
71 CONFIGURE_FILE(scripts/12_appsvc-add.post.in
72   scripts/12_appsvc-add.post @ONLY)
73 CONFIGURE_FILE(scripts/501.appsvc_db_upgrade.sh.in
74   scripts/501.appsvc_db_upgrade.sh @ONLY)
75 CONFIGURE_FILE(scripts/upgrade/1_appsvc_db_upgrade.sh.in
76   scripts/upgrade/1_appsvc_db_upgrade.sh @ONLY)
77 CONFIGURE_FILE(scripts/upgrade/2_appsvc_db_upgrade.sh.in
78   scripts/upgrade/2_appsvc_db_upgrade.sh @ONLY)
79
80 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/501.appsvc_db_upgrade.sh
81   DESTINATION /usr/share/upgrade/scripts)
82 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/upgrade/1_appsvc_db_upgrade.sh
83   DESTINATION /etc/aul/upgrade/scripts)
84 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/upgrade/2_appsvc_db_upgrade.sh
85   DESTINATION /etc/aul/upgrade/scripts)
86 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/feature/preexec_list.txt
87   DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
88 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/miregex
89   DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
90
91 ## Sub directories
92 ADD_SUBDIRECTORY(src)
93 ADD_SUBDIRECTORY(test)