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 "COMMON")
15 ${CMAKE_SOURCE_DIR}/include
16 ${CMAKE_SOURCE_DIR}/include/common
18 INCLUDE(FindPkgConfig)
19 pkg_check_modules(pkgs REQUIRED
38 capi-appfw-application
39 capi-appfw-app-manager
40 capi-network-bluetooth
41 capi-system-system-settings
54 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
57 ${CMAKE_SOURCE_DIR}/include
58 ${CMAKE_SOURCE_DIR}/include/mobile
60 INCLUDE(FindPkgConfig)
61 pkg_check_modules(pkgs REQUIRED
80 capi-appfw-application
81 capi-appfw-app-manager
82 capi-network-bluetooth
83 capi-system-system-settings
96 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
99 ${CMAKE_SOURCE_DIR}/include
100 ${CMAKE_SOURCE_DIR}/include/wearable
102 INCLUDE(FindPkgConfig)
103 pkg_check_modules(pkgs REQUIRED
105 capi-system-media-key
122 capi-appfw-application
123 capi-appfw-app-manager
124 capi-network-bluetooth
134 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "IVI")
137 ${CMAKE_SOURCE_DIR}/include
138 ${CMAKE_SOURCE_DIR}/include/ivi
140 INCLUDE(FindPkgConfig)
141 pkg_check_modules(pkgs REQUIRED
143 capi-system-media-key
160 capi-appfw-application
161 capi-appfw-app-manager
162 capi-network-bluetooth
163 capi-system-system-settings
179 pkg_check_modules(pkgs REQUIRED
185 FOREACH(flag ${pkgs_CFLAGS})
186 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
189 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
190 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
191 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
192 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
193 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
194 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
195 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fPIE")
196 SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
197 SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage -fPIE")
199 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
201 FIND_PROGRAM(UNAME NAMES uname)
202 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
203 IF("${ARCH}" STREQUAL "arm")
204 ADD_DEFINITIONS("-DTARGET")
205 MESSAGE("add -DTARGET")
206 ENDIF("${ARCH}" STREQUAL "arm")
208 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
209 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
210 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
211 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
212 ADD_DEFINITIONS("-D_GNU_SOURCE")
215 ADD_DEFINITIONS("-DHAVE_X11")
219 ADD_DEFINITIONS("-DHAVE_WAYLAND")
220 ENDIF(WAYLAND_SUPPORT)
222 IF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
230 src/common/home_mgr.c
231 src/common/lock_mgr.c
233 src/common/window_mgr.c
238 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
246 src/mobile/home_mgr.c
247 src/mobile/lock_mgr.c
249 src/mobile/window_mgr.c
254 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
262 src/wearable/clock_mgr.c
263 src/wearable/home_mgr.c
264 src/wearable/hourly_alert.c
265 src/wearable/hw_key.c
266 src/wearable/starter.c
269 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "IVI")
287 ADD_EXECUTABLE(${PROJECT_NAME} ${BUILD_SOURCE})
288 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
289 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
290 INSTALL(DIRECTORY DESTINATION ${DATADIR})
292 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
293 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
294 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
295 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
296 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
297 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
298 #INSTALL to /etc/init.d