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
98 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
101 ${CMAKE_SOURCE_DIR}/include
102 ${CMAKE_SOURCE_DIR}/include/wearable
104 INCLUDE(FindPkgConfig)
105 pkg_check_modules(pkgs REQUIRED
107 capi-system-media-key
124 capi-appfw-application
125 capi-appfw-app-manager
126 capi-network-bluetooth
136 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "IVI")
139 ${CMAKE_SOURCE_DIR}/include
140 ${CMAKE_SOURCE_DIR}/include/ivi
142 INCLUDE(FindPkgConfig)
143 pkg_check_modules(pkgs REQUIRED
145 capi-system-media-key
162 capi-appfw-application
163 capi-appfw-app-manager
164 capi-network-bluetooth
165 capi-system-system-settings
181 pkg_check_modules(pkgs REQUIRED
187 FOREACH(flag ${pkgs_CFLAGS})
188 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
191 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
192 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
193 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
194 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
195 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
196 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
197 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fPIE")
198 SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
199 SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage -fPIE")
201 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
203 FIND_PROGRAM(UNAME NAMES uname)
204 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
205 IF("${ARCH}" STREQUAL "arm")
206 ADD_DEFINITIONS("-DTARGET")
207 MESSAGE("add -DTARGET")
208 ENDIF("${ARCH}" STREQUAL "arm")
210 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
211 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
212 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
213 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
214 ADD_DEFINITIONS("-D_GNU_SOURCE")
217 ADD_DEFINITIONS("-DHAVE_X11")
221 ADD_DEFINITIONS("-DHAVE_WAYLAND")
222 ENDIF(WAYLAND_SUPPORT)
224 IF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
232 src/common/home_mgr.c
233 src/common/lock_mgr.c
235 src/common/window_mgr.c
240 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
248 src/mobile/home_mgr.c
249 src/mobile/lock_mgr.c
251 src/mobile/window_mgr.c
256 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
264 src/wearable/clock_mgr.c
265 src/wearable/home_mgr.c
266 src/wearable/hourly_alert.c
267 src/wearable/hw_key.c
268 src/wearable/starter.c
271 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "IVI")
289 ADD_EXECUTABLE(${PROJECT_NAME} ${BUILD_SOURCE})
290 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
291 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
292 INSTALL(DIRECTORY DESTINATION ${DATADIR})
294 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
295 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
296 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
297 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
298 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
299 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
300 #INSTALL to /etc/init.d