1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
5 SET(PACKAGE ${PROJECT_NAME})
6 SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
7 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
8 SET(BINDIR "${PREFIX}/bin")
9 SET(DATADIR "${PREFIX}/share")
10 SET(LOCALEDIR "${DATADIR}/locale")
12 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
14 INCLUDE(FindPkgConfig)
15 pkg_check_modules(pkgs REQUIRED
41 capi-appfw-application
44 FOREACH(flag ${pkgs_CFLAGS})
45 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
48 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
49 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
50 SET(CMAKE_C_FLAGS_RELEASE "-O2")
52 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
54 FIND_PROGRAM(UNAME NAMES uname)
55 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
56 IF("${ARCH}" STREQUAL "arm")
57 ADD_DEFINITIONS("-DTARGET")
58 MESSAGE("add -DTARGET")
59 ENDIF("${ARCH}" STREQUAL "arm")
61 ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
62 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
63 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
64 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
65 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
66 ADD_DEFINITIONS("-D_GNU_SOURCE")
68 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
70 ADD_EXECUTABLE(${PROJECT_NAME}
79 src/lockd-process-mgr.c
80 src/lockd-window-mgr.c
82 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
83 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
85 SET(LOCK_SETTING lock-setting)
87 ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${LOCK_SETTING})
89 # install desktop file & icon
90 #CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PROJECT_NAME}.desktop)
91 #INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION share/applications)
93 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
94 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
95 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
96 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
97 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
98 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
99 #INSTALL to /etc/init.d