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}\"")
17 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-zdefs -fvisibility=hidden -g -Wall -Werror -fpic ")
18 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
19 SET(CMAKE_C_FLAGS_RELEASE "-O2")
21 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS} -std=c++14")
22 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
23 SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
25 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
27 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
33 SET(TARGET_AUL_UNIT_TESTS "aul-unit-tests")
34 SET(TARGET_APP_CONTROL_TESTS "app-control-tests")
36 INCLUDE(FindPkgConfig)
37 INCLUDE(ApplyPkgConfig)
39 PKG_CHECK_MODULES(BUNDLE_DEPS REQUIRED bundle)
40 PKG_CHECK_MODULES(CAPI_SYSTEM_INFO_DEPS REQUIRED capi-system-info)
41 PKG_CHECK_MODULES(DLOG_DEPS REQUIRED dlog)
42 PKG_CHECK_MODULES(GIO_DEPS REQUIRED gio-2.0)
43 PKG_CHECK_MODULES(GLIB_DEPS REQUIRED glib-2.0)
44 PKG_CHECK_MODULES(GMOCK_DEPS REQUIRED gmock)
45 PKG_CHECK_MODULES(INIPARSER_DEPS REQUIRED iniparser)
46 PKG_CHECK_MODULES(LIBSMACK_DEPS REQUIRED libsmack)
47 PKG_CHECK_MODULES(LIBTZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config)
48 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
49 PKG_CHECK_MODULES(PARCEL_DEPS REQUIRED parcel)
50 PKG_CHECK_MODULES(PKGMGR_INFO_DEPS REQUIRED pkgmgr-info)
51 PKG_CHECK_MODULES(PKGMGR_INSTALLER_DEPS REQUIRED pkgmgr-installer)
52 PKG_CHECK_MODULES(SQLITE3_DEPS REQUIRED sqlite3)
53 PKG_CHECK_MODULES(STORAGE_DEPS REQUIRED storage)
54 PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace)
55 PKG_CHECK_MODULES(UUID_DEPS REQUIRED uuid)
56 PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
57 PKG_CHECK_MODULES(XDGMIME_DEPS REQUIRED xdgmime)
60 AUX_SOURCE_DIRECTORY(src SRCS)
61 AUX_SOURCE_DIRECTORY(aul AUL_SRCS)
62 AUX_SOURCE_DIRECTORY(aul/api AUL_API_SRCS)
63 AUX_SOURCE_DIRECTORY(aul/app_control AUL_APP_CONTROL_SRCS)
64 AUX_SOURCE_DIRECTORY(aul/app_manager AUL_APP_MANAGER_SRCS)
65 AUX_SOURCE_DIRECTORY(aul/app_info AUL_APP_INFO_SRCS)
66 AUX_SOURCE_DIRECTORY(aul/common AUL_COMMON_SRCS)
67 AUX_SOURCE_DIRECTORY(aul/component AUL_COMPONENT_SRCS)
68 AUX_SOURCE_DIRECTORY(aul/socket AUL_SOCKET_SRCS)
70 ADD_LIBRARY(${TARGET_AUL} SHARED
74 ${AUL_APP_CONTROL_SRCS}
75 ${AUL_APP_MANAGER_SRCS}
82 TARGET_INCLUDE_DIRECTORIES(${TARGET_AUL} PUBLIC
83 ${CMAKE_CURRENT_SOURCE_DIR}
84 ${CMAKE_CURRENT_SOURCE_DIR}/include
85 ${CMAKE_CURRENT_SOURCE_DIR}/include/internal
86 ${CMAKE_CURRENT_SOURCE_DIR}/aul/
87 ${CMAKE_CURRENT_SOURCE_DIR}/aul/api
88 ${CMAKE_CURRENT_SOURCE_DIR}/aul/app_control
89 ${CMAKE_CURRENT_SOURCE_DIR}/aul/app_manager
90 ${CMAKE_CURRENT_SOURCE_DIR}/aul/common
91 ${CMAKE_CURRENT_SOURCE_DIR}/aul/component
92 ${CMAKE_CURRENT_SOURCE_DIR}/aul/socket
95 SET_TARGET_PROPERTIES(${TARGET_AUL} PROPERTIES SOVERSION ${MAJORVER})
96 SET_TARGET_PROPERTIES(${TARGET_AUL} PROPERTIES VERSION ${FULLVER})
98 APPLY_PKG_CONFIG(${TARGET_AUL} PUBLIC
100 CAPI_SYSTEM_INFO_DEPS
106 LIBTZPLATFORM_CONFIG_DEPS
117 INSTALL(TARGETS ${TARGET_AUL} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
120 CONFIGURE_FILE(aul.pc.in aul.pc @ONLY)
121 CONFIGURE_FILE(feature/preexec_list.txt.in feature/preexec_list.txt @ONLY)
122 CONFIGURE_FILE(data/appsvc_db.sql.in data/appsvc_db.sql @ONLY)
123 CONFIGURE_FILE(scripts/501.appsvc_db_upgrade.sh.in scripts/501.appsvc_db_upgrade.sh @ONLY)
124 CONFIGURE_FILE(scripts/upgrade/1_appsvc_db_upgrade.sh.in scripts/upgrade/1_appsvc_db_upgrade.sh @ONLY)
126 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/501.appsvc_db_upgrade.sh
127 DESTINATION /usr/share/upgrade/scripts)
128 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/upgrade/1_appsvc_db_upgrade.sh
129 DESTINATION /etc/aul/upgrade/scripts)
130 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/aul.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
131 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/feature/preexec_list.txt DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
132 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/miregex DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
133 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aul.conf DESTINATION /etc/dbus-1/system.d)
134 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/aul
138 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/aul/api/ DESTINATION include/aul/api
144 ADD_SUBDIRECTORY(parser)
145 ADD_SUBDIRECTORY(server)
146 ADD_SUBDIRECTORY(test)
147 ADD_SUBDIRECTORY(tool)