1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 IF("${POWEROFF_POPUP}" STREQUAL "off")
5 ENDIF("${POWEROFF_POPUP}" STREQUAL "off")
7 SET(POWEROFF_SRCS ${COMMON_SRCS} poweroff.c)
9 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
10 INCLUDE_DIRECTORIES(${COMMON_DIR})
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")
37 IF("${DPMS}" STREQUAL "x")
38 SET(PKG_MODULES ${PKG_MODULES}
42 ENDIF("${DPMS}" STREQUAL "x")
44 INCLUDE(FindPkgConfig)
45 pkg_check_modules(poweroff_pkgs REQUIRED ${PKG_MODULES})
47 FOREACH(flag ${poweroff_pkgs_CFLAGS})
48 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
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")
55 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
56 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
57 ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
59 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
61 ADD_EXECUTABLE(${EXECNAME} ${POWEROFF_SRCS})
62 TARGET_LINK_LIBRARIES(${EXECNAME} ${poweroff_pkgs_LDFLAGS})
64 INSTALL(TARGETS ${EXECNAME} DESTINATION ${TZ_SYS_RO_APP}/${PKGNAME}/bin)
65 INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/poweroff/${PKGNAME}.xml DESTINATION ${MANIFESTDIR})
67 INSTALL(FILES ${CMAKE_SOURCE_DIR}/circle_btn_check.png DESTINATION ${RESDIR})
68 INSTALL(FILES ${CMAKE_SOURCE_DIR}/circle_btn_delete.png DESTINATION ${RESDIR})