1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
3 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
4 SET(EXEC_PREFIX "\${prefix}")
5 SET(VERSION ${FULLVER})
8 AUX_SOURCE_DIRECTORY(src SOURCES)
10 ADD_DEFINITIONS("-DSHARE_PREFIX=\"${SHARE_INSTALL_PREFIX}/aul\"")
12 # Set required packages
13 INCLUDE(FindPkgConfig)
14 SET(AUL-1_LIB_PKG_CHECK_MODULES dlog bundle xdgmime libtzplatform-config pkgmgr-info capi-system-info vconf sqlite3 iniparser gio-2.0 glib-2.0 libxml-2.0 ttrace storage)
15 pkg_check_modules(libpkgs REQUIRED ${AUL-1_LIB_PKG_CHECK_MODULES})
17 FOREACH(flag ${libpkgs_CFLAGS})
18 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
21 pkg_check_modules(APP_LAUNCHER_DEPS glib-2.0 pkgmgr-info bundle)
22 FOREACH(APP_LAUNCHER_FLAGS ${APP_LAUNCHER_DEPS_CFLAGS})
23 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${APP_LAUNCHER_FLAGS}")
24 ENDFOREACH(APP_LAUNCHER_FLAGS)
27 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
28 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/legacy)
29 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/feature)
30 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" )
31 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpic")
33 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
34 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
35 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
36 SET(CMAKE_C_FLAGS_RELEASE "-O2")
37 SET(CMAKE_SKIP_BUILD_RPATH true)
39 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
42 add_library(aul SHARED ${SOURCES})
43 TARGET_LINK_LIBRARIES(aul ${libpkgs_LDFLAGS})
44 SET_TARGET_PROPERTIES(aul PROPERTIES SOVERSION ${MAJORVER})
45 SET_TARGET_PROPERTIES(aul PROPERTIES VERSION ${FULLVER})
46 INSTALL(TARGETS aul DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
49 CONFIGURE_FILE(aul.pc.in aul.pc @ONLY)
50 CONFIGURE_FILE(feature/preexec_list.txt.in feature/preexec_list.txt @ONLY)
52 # Install headers, other files
53 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul.h DESTINATION include/aul)
54 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_sock.h DESTINATION include/aul)
55 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_proc.h DESTINATION include/aul)
56 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_rsc_mgr.h DESTINATION include/aul)
57 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_svc.h DESTINATION include/aul)
58 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_cmd.h DESTINATION include/aul)
59 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_app_com.h DESTINATION include/aul)
60 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_screen_connector.h DESTINATION include/aul)
61 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_window.h DESTINATION include/aul)
62 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_widget.h DESTINATION include/aul)
63 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_job_scheduler.h DESTINATION include/aul)
64 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_rpc_port.h DESTINATION include/aul)
65 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_complication.h DESTINATION include/aul)
66 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_debug_info.h DESTINATION include/aul)
67 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/aul_watchdog.h DESTINATION include/aul)
68 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/aul.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
69 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/feature/preexec_list.txt DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
70 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/miregex DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
71 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/aul.conf DESTINATION /etc/dbus-1/system.d)
74 ADD_SUBDIRECTORY(tool)
75 ADD_SUBDIRECTORY(parser)