1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(PACKAGE ${PROJECT_NAME})
5 SET(PKGNAME "org.tizen.${PACKAGE}")
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(BINDIR "${PREFIX}/bin")
8 SET(DATADIR "${PREFIX}/share")
9 SET(RESDIR "${PREFIX}/res")
10 SET(LOCALEDIR "${PREFIX}/share/locale")
12 IF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
14 ${CMAKE_SOURCE_DIR}/include
15 ${CMAKE_SOURCE_DIR}/include/mobile
17 INCLUDE(FindPkgConfig)
18 pkg_check_modules(pkgs REQUIRED
38 capi-appfw-application
39 capi-appfw-app-manager
40 capi-network-bluetooth
41 capi-system-system-settings
56 ${CMAKE_SOURCE_DIR}/include
57 ${CMAKE_SOURCE_DIR}/include/wearable
59 INCLUDE(FindPkgConfig)
60 pkg_check_modules(pkgs REQUIRED
80 capi-appfw-application
81 capi-appfw-app-manager
82 capi-network-bluetooth
94 FOREACH(flag ${pkgs_CFLAGS})
95 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
98 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
99 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
100 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
101 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
102 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
103 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
104 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fPIE")
105 SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
106 SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage -fPIE")
108 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
110 FIND_PROGRAM(UNAME NAMES uname)
111 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
112 IF("${ARCH}" STREQUAL "arm")
113 ADD_DEFINITIONS("-DTARGET")
114 MESSAGE("add -DTARGET")
115 ENDIF("${ARCH}" STREQUAL "arm")
117 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
118 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
119 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
120 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
121 ADD_DEFINITIONS("-D_GNU_SOURCE")
123 IF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
124 ADD_EXECUTABLE(${PROJECT_NAME}
131 src/mobile/home_mgr.c
133 #src/mobile/lock_mgr.c
134 #src/mobile/lock_pwd_util.c
135 #src/mobile/lock_pwd_simple.c
136 #src/mobile/lock_pwd_complex.c
137 #src/mobile/lock_pwd_control_panel.c
138 #src/mobile/lock_pwd_verification.c
139 #src/mobile/window_mgr.c
143 ADD_EXECUTABLE(${PROJECT_NAME}
149 src/wearable/clock_mgr.c
150 src/wearable/home_mgr.c
151 src/wearable/hourly_alert.c
152 src/wearable/hw_key.c
153 src/wearable/starter.c
156 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
157 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
158 INSTALL(DIRECTORY DESTINATION ${DATADIR})
160 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
161 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
162 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
163 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
164 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
165 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
166 #INSTALL to /etc/init.d
168 INSTALL(FILES starter.efl DESTINATION /etc/smack/accesses.d)
170 ADD_SUBDIRECTORY(res)