CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(starter C)
-SET(VENDOR "tizen")
SET(PACKAGE ${PROJECT_NAME})
-SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
+SET(PKGNAME "org.tizen.${PACKAGE}")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
SET(DATADIR "${PREFIX}/share")
-SET(LOCALEDIR "${DATADIR}/locale")
+SET(RESDIR "${PREFIX}/res")
+SET(LOCALEDIR "${PREFIX}/share/locale")
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+IF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/include/common
+)
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
- ail
aul
capi-system-media-key
db-util
dlog
ecore
+ ecore-wayland
ecore-evas
ecore-input
- ecore-x
- eet
+ edbus
eina
elementary
evas
- heynoti
- sysman
syspopup-caller
- utilX
vconf
- x11
- xcomposite
- xext
appcore-efl
glib-2.0
ui-gadget-1
bundle
capi-appfw-application
+ capi-appfw-app-manager
+ capi-network-bluetooth
+ capi-system-system-settings
+ feedback
+ alarm-service
+ pkgmgr-info
+ deviced
+ edbus
+ dbus-1
+ dbus-glib-1
+ tts
+ capi-message-port
+ efl-extension
+)
+
+ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/include/mobile
+)
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ aul
+ capi-system-media-key
+ db-util
+ dlog
+ ecore
+ ecore-wayland
+ ecore-evas
+ ecore-input
+ edbus
+ eina
+ elementary
+ evas
+ syspopup-caller
+ vconf
+ appcore-efl
+ glib-2.0
+ ui-gadget-1
+ bundle
+ capi-appfw-application
+ capi-appfw-app-manager
+ capi-network-bluetooth
+ capi-system-system-settings
capi-system-info
+ capi-telephony
+ feedback
+ alarm-service
+ pkgmgr-info
+ deviced
+ edbus
+ dbus-1
+ dbus-glib-1
+ tts
+ capi-message-port
+ efl-extension
+ liblazymount
+ libsystemd-daemon
)
+ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
+
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_SOURCE_DIR}/include/wearable
+)
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ aul
+ capi-system-media-key
+ db-util
+ dlog
+ ecore
+ ecore-evas
+ ecore-input
+ ecore-wayland
+ edbus
+ eina
+ elementary
+ evas
+ syspopup-caller
+ vconf
+ appcore-efl
+ glib-2.0
+ ui-gadget-1
+ bundle
+ capi-appfw-application
+ capi-appfw-app-manager
+ capi-network-bluetooth
+ feedback
+ alarm-service
+ pkgmgr-info
+ deviced
+ edbus
+ dbus-1
+ dbus-glib-1
+ liblazymount
+ libsystemd-daemon
+)
+
+ENDIF()
+
+IF(X11_SUPPORT)
+pkg_check_modules(pkgs REQUIRED
+ ecore-x
+ utilX
+ )
+ENDIF(X11_SUPPORT)
+
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_C_FLAGS_RELEASE "-O2")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -fPIE")
+SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg -fPIE")
+SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg -fPIE")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g -fPIE")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -g -fPIE")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g -fPIE")
+SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage -fPIE")
+SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage -fPIE")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
MESSAGE("add -DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
-ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-D_GNU_SOURCE")
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-ADD_EXECUTABLE(${PROJECT_NAME}
- src/hw_key.c
- src/pkg_event.c
- src/menu_daemon.c
- src/starter.c
- src/x11.c
- src/xmonitor.c
- src/lock-daemon.c
- src/lockd-debug.c
- src/lockd-process-mgr.c
- src/lockd-window-mgr.c
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ENDIF(X11_SUPPORT)
+
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+IF("${TIZEN_PROFILE_NAME}" STREQUAL "COMMON")
+
+SET(BUILD_SOURCE
+ src/dbus_util.c
+ src/package_mgr.c
+ src/process_mgr.c
+ src/status.c
+
+ src/common/home_mgr.c
+ src/common/lock_mgr.c
+ src/common/starter.c
+ src/common/popup.c
+ src/common/hw_key.c
)
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
-SET(LOCK_SETTING lock-setting)
+ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE")
-ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${LOCK_SETTING})
+SET(BUILD_SOURCE
+ src/dbus_util.c
+ src/package_mgr.c
+ src/process_mgr.c
+ src/status.c
-# install desktop file & icon
-#CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PROJECT_NAME}.desktop)
-#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION share/applications)
+ src/mobile/home_mgr.c
+ src/mobile/lock_mgr.c
+ src/mobile/starter.c
+ src/mobile/popup.c
+ src/mobile/hw_key.c
+)
+
+ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
+
+SET(BUILD_SOURCE
+ src/dbus_util.c
+ src/package_mgr.c
+ src/process_mgr.c
+ src/status.c
+
+ src/wearable/clock_mgr.c
+ src/wearable/home_mgr.c
+ src/wearable/hourly_alert.c
+ src/wearable/hw_key.c
+ src/wearable/starter.c
+)
+
+ENDIF()
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${BUILD_SOURCE})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
+INSTALL(DIRECTORY DESTINATION ${DATADIR})
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
-#INSTALL to /etc/init.d
+ADD_SUBDIRECTORY(po)