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
36 capi-appfw-application
37 capi-appfw-app-manager
38 capi-network-bluetooth
39 capi-system-system-settings
54 pkg_check_modules(pkgs REQUIRED
62 ${CMAKE_SOURCE_DIR}/include
63 ${CMAKE_SOURCE_DIR}/include/wearable
65 INCLUDE(FindPkgConfig)
66 pkg_check_modules(pkgs REQUIRED
84 capi-appfw-application
85 capi-appfw-app-manager
86 capi-network-bluetooth
97 pkg_check_modules(pkgs REQUIRED
106 FOREACH(flag ${pkgs_CFLAGS})
107 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
110 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
111 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
112 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
113 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
114 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
115 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
116 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fPIE")
117 SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
118 SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage -fPIE")
120 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
122 FIND_PROGRAM(UNAME NAMES uname)
123 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
124 IF("${ARCH}" STREQUAL "arm")
125 ADD_DEFINITIONS("-DTARGET")
126 MESSAGE("add -DTARGET")
127 ENDIF("${ARCH}" STREQUAL "arm")
129 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
130 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
131 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
132 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
133 ADD_DEFINITIONS("-D_GNU_SOURCE")
136 ADD_DEFINITIONS("-DHAVE_X11")
140 ADD_DEFINITIONS("-DHAVE_WAYLAND")
141 ENDIF(WAYLAND_SUPPORT)
143 IF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
150 src/mobile/home_mgr.c
152 src/mobile/lock_mgr.c
153 src/mobile/lock_pwd_util.c
154 src/mobile/lock_pwd_simple.c
155 src/mobile/lock_pwd_complex.c
156 src/mobile/lock_pwd_control_panel.c
157 src/mobile/lock_pwd_verification.c
158 src/mobile/window_mgr.c
168 ELSE("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
175 src/wearable/clock_mgr.c
176 src/wearable/home_mgr.c
177 src/wearable/hourly_alert.c
178 src/wearable/starter.c
183 src/wearable/hw_key.c
186 ENDIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
188 ADD_EXECUTABLE(${PROJECT_NAME} ${BUILD_SOURCE})
189 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
190 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
191 INSTALL(DIRECTORY DESTINATION ${DATADIR})
193 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
194 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
195 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
196 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
197 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
198 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
199 #INSTALL to /etc/init.d
201 ADD_SUBDIRECTORY(res)