1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
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}")
11 ADD_DEFINITIONS("-DSHARE_PREFIX=\"${SHARE_INSTALL_PREFIX}/aul\"")
13 ADD_DEFINITIONS("-DAPPSVC_DB_VERSION=\"${APPSVC_DB_VERSION}\"")
14 ADD_DEFINITIONS("-DCOMPONENT_DB_VERSION=\"${COMPONENT_DB_VERSION}\"")
15 ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
18 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-zdefs -fvisibility=hidden -g -Wall -Werror -fpic ")
19 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
20 SET(CMAKE_C_FLAGS_RELEASE "-O2")
22 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS} -std=c++17")
23 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
24 SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
26 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
28 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
32 SET(TARGET_AUL_SERVER "aul-server")
35 SET(TARGET_AUL_UNIT_TESTS "aul-unit-tests")
36 SET(TARGET_APP_CONTROL_TESTS "app-control-tests")
38 INCLUDE(FindPkgConfig)
39 INCLUDE(ApplyPkgConfig)
41 PKG_CHECK_MODULES(BUNDLE_DEPS REQUIRED bundle)
42 PKG_CHECK_MODULES(CAPI_SYSTEM_INFO_DEPS REQUIRED capi-system-info)
43 PKG_CHECK_MODULES(CAPI_SYSTEM_RESOURCE_DEPS REQUIRED capi-system-resource)
44 PKG_CHECK_MODULES(DLOG_DEPS REQUIRED dlog)
45 PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0)
46 PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
47 PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
48 PKG_CHECK_MODULES(INIPARSER_DEPS REQUIRED iniparser)
49 PKG_CHECK_MODULES(LIBSMACK_DEPS REQUIRED libsmack)
50 PKG_CHECK_MODULES(LIBTZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config)
51 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
52 PKG_CHECK_MODULES(PARCEL_DEPS REQUIRED parcel)
53 PKG_CHECK_MODULES(PKGMGR_INFO_DEPS REQUIRED pkgmgr-info)
54 PKG_CHECK_MODULES(PKGMGR_INSTALLER_DEPS REQUIRED pkgmgr-installer)
55 PKG_CHECK_MODULES(SQLITE3_DEPS REQUIRED sqlite3)
56 PKG_CHECK_MODULES(STORAGE_DEPS REQUIRED storage)
57 PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace)
58 PKG_CHECK_MODULES(UUID_DEPS REQUIRED uuid)
59 PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
60 PKG_CHECK_MODULES(XDGMIME_DEPS REQUIRED xdgmime)
63 AUX_SOURCE_DIRECTORY(src SRCS)
64 AUX_SOURCE_DIRECTORY(aul AUL_SRCS)
65 AUX_SOURCE_DIRECTORY(aul/api AUL_API_SRCS)
66 AUX_SOURCE_DIRECTORY(aul/app_control AUL_APP_CONTROL_SRCS)
67 AUX_SOURCE_DIRECTORY(aul/app_manager AUL_APP_MANAGER_SRCS)
68 AUX_SOURCE_DIRECTORY(aul/app_info AUL_APP_INFO_SRCS)
69 AUX_SOURCE_DIRECTORY(aul/common AUL_COMMON_SRCS)
70 AUX_SOURCE_DIRECTORY(aul/component AUL_COMPONENT_SRCS)
71 AUX_SOURCE_DIRECTORY(aul/socket AUL_SOCKET_SRCS)
73 ADD_LIBRARY(${TARGET_AUL} SHARED
77 ${AUL_APP_CONTROL_SRCS}
78 ${AUL_APP_MANAGER_SRCS}
83 ${AUL_BOOT_SEQUENCE_SRCS}
86 TARGET_INCLUDE_DIRECTORIES(${TARGET_AUL} PUBLIC
87 ${CMAKE_CURRENT_SOURCE_DIR}
88 ${CMAKE_CURRENT_SOURCE_DIR}/include
89 ${CMAKE_CURRENT_SOURCE_DIR}/include/internal
90 ${CMAKE_CURRENT_SOURCE_DIR}/aul/
91 ${CMAKE_CURRENT_SOURCE_DIR}/aul/api
92 ${CMAKE_CURRENT_SOURCE_DIR}/aul/app_control
93 ${CMAKE_CURRENT_SOURCE_DIR}/aul/app_manager
94 ${CMAKE_CURRENT_SOURCE_DIR}/aul/common
95 ${CMAKE_CURRENT_SOURCE_DIR}/aul/component
96 ${CMAKE_CURRENT_SOURCE_DIR}/aul/socket
99 SET_TARGET_PROPERTIES(${TARGET_AUL} PROPERTIES SOVERSION ${MAJORVER})
100 SET_TARGET_PROPERTIES(${TARGET_AUL} PROPERTIES VERSION ${FULLVER})
102 APPLY_PKG_CONFIG(${TARGET_AUL} PUBLIC
104 CAPI_SYSTEM_INFO_DEPS
105 CAPI_SYSTEM_RESOURCE_DEPS
111 LIBTZPLATFORM_CONFIG_DEPS
122 INSTALL(TARGETS ${TARGET_AUL} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
125 CONFIGURE_FILE(aul.pc.in aul.pc @ONLY)
126 CONFIGURE_FILE(feature/preexec_list.txt.in feature/preexec_list.txt @ONLY)
127 CONFIGURE_FILE(data/appsvc_db.sql.in data/appsvc_db.sql @ONLY)
128 CONFIGURE_FILE(scripts/12_appsvc-add.post.in scripts/12_appsvc-add.post @ONLY)
129 CONFIGURE_FILE(scripts/501.appsvc_db_upgrade.sh.in scripts/501.appsvc_db_upgrade.sh @ONLY)
130 CONFIGURE_FILE(scripts/upgrade/1_appsvc_db_upgrade.sh.in scripts/upgrade/1_appsvc_db_upgrade.sh @ONLY)
131 CONFIGURE_FILE(scripts/upgrade/2_appsvc_db_upgrade.sh.in scripts/upgrade/2_appsvc_db_upgrade.sh @ONLY)
133 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/501.appsvc_db_upgrade.sh
134 DESTINATION /usr/share/upgrade/scripts)
135 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/upgrade/1_appsvc_db_upgrade.sh
136 DESTINATION /etc/aul/upgrade/scripts)
137 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/upgrade/2_appsvc_db_upgrade.sh
138 DESTINATION /etc/aul/upgrade/scripts)
139 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/aul.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
140 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/feature/preexec_list.txt DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
141 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/miregex DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
142 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aul.conf DESTINATION /etc/dbus-1/system.d)
143 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/aul
147 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/aul/api/ DESTINATION include/aul/api
153 ADD_SUBDIRECTORY(parser)
154 ADD_SUBDIRECTORY(server)
155 ADD_SUBDIRECTORY(test)
156 ADD_SUBDIRECTORY(tool)