12b9aa80110a5ff3e78f5c8b3ce9c5331b6eb8d5
[platform/core/system/system-popup.git] / src / poweroff / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 IF("${POWEROFF_POPUP}" STREQUAL "off")
4         RETURN()
5 ENDIF("${POWEROFF_POPUP}" STREQUAL "off")
6
7 SET(POWEROFF_SRCS ${COMMON_SRCS} poweroff.c)
8
9 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
10 INCLUDE_DIRECTORIES(${COMMON_DIR})
11
12 SET(VENDOR "tizen")
13 SET(PACKAGE "poweroff-syspopup")
14 SET(EXECNAME "poweroff-popup")
15 SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
16 SET(POWEROFF_PREFIX "${TZ_SYS_RO_APP}/${PKGNAME}")
17 SET(BINDIR "${POWEROFF_PREFIX}/bin")
18 SET(RESDIR "${POWEROFF_PREFIX}/res")
19 SET(MANIFESTDIR "${TZ_SYS_RO_SHARE}/packages")
20
21 SET(PKG_MODULES
22                 appcore-efl
23                 elementary
24                 dlog
25                 deviced
26                 evas
27                 ecore
28                 edbus
29                 glib-2.0
30                 vconf
31                 syspopup
32                 syspopup-caller
33                 feedback
34                 efl-extension
35 )
36
37 IF("${DPMS}" STREQUAL "x")
38 SET(PKG_MODULES ${PKG_MODULES}
39                 ecore-x
40                 utilX
41 )
42 ENDIF("${DPMS}" STREQUAL "x")
43
44 INCLUDE(FindPkgConfig)
45 pkg_check_modules(poweroff_pkgs REQUIRED ${PKG_MODULES})
46
47 FOREACH(flag ${poweroff_pkgs_CFLAGS})
48         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
49 ENDFOREACH(flag)
50
51 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O2 -g -Wall -fpie")
52 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie")
53 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie")
54
55 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
56 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
57 ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
58
59 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
60
61 ADD_EXECUTABLE(${EXECNAME} ${POWEROFF_SRCS})
62 TARGET_LINK_LIBRARIES(${EXECNAME} ${poweroff_pkgs_LDFLAGS})
63
64 INSTALL(TARGETS ${EXECNAME} DESTINATION ${TZ_SYS_RO_APP}/${PKGNAME}/bin)
65 INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/poweroff/${PKGNAME}.xml DESTINATION ${MANIFESTDIR})
66
67 INSTALL(FILES ${CMAKE_SOURCE_DIR}/circle_btn_check.png DESTINATION ${RESDIR})
68 INSTALL(FILES ${CMAKE_SOURCE_DIR}/circle_btn_delete.png DESTINATION ${RESDIR})