1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(org.tizen.multi-assistant-service CXX C)
5 SET ( PACKAGE "org.tizen.multi-assistant-service")
6 SET ( PKGNAME ${PACKAGE})
7 SET ( PREFIX ${CMAKE_INSTALL_PREFIX})
8 SET ( BINDIR "${PREFIX}/bin")
9 SET ( RESDIR "${PREFIX}/res")
10 SET ( LIBDIR "${PREFIX}/lib")
11 SET ( SHARED_RESDIR "${PREFIX}/shared/res")
12 SET ( BINNAME org.tizen.multi-assistant-service)
14 # SET FLAG ---------------------------------------------------------------------------------------
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(pkgs REQUIRED
18 capi-appfw-application
19 capi-appfw-app-manager
20 capi-appfw-package-manager
22 capi-appfw-service-application
24 capi-network-connection
36 # SET FLAG ---------------------------------------------------------------------------------------
37 FOREACH(flag ${pkgs_CFLAGS})
38 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
41 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
42 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,relro -fPIE -pie -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden")
43 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,relro -fPIE -pie -fvisibility=hidden")
45 # SET WARNNING OPTION ----------------------------------------------------------------------------
46 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
47 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
49 # OPTION DEBUG -----------------------------------------------------------------------------------
50 IF("${_SDEBUG}" MATCHES "debug")
51 MESSAGE("Building in debug mode.")
52 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -O0")
53 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG} -O0")
55 MESSAGE("Building in release mode.")
56 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
57 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
60 LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)
61 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
62 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)
66 src/multi_assistant_config.cpp
67 src/multi_assistant_service.cpp
68 src/multi_assistant_service_plugin.cpp
69 src/multi_assistant_dbus.cpp
70 src/multi_assistant_dbus_server.cpp
72 ADD_EXECUTABLE(${BINNAME} ${SRCS})
74 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE.Flora DESTINATION /usr/share/license/)
75 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PKGNAME}.xml DESTINATION /usr/share/packages)
76 INSTALL(TARGETS ${BINNAME} DESTINATION ${BINDIR})
78 TARGET_LINK_LIBRARIES(${BINNAME} -ldl ${pkgs_LDFLAGS} ${EXTRA_LDFLAGS})
80 ADD_SUBDIRECTORY(plugins)
82 IF(NOT "${TEST_TYPE}" STREQUAL "none")
84 ADD_SUBDIRECTORY(tests)