init wayland support
[apps/native/starter.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(starter C)
3
4 SET(VENDOR "tizen")
5 SET(PACKAGE ${PROJECT_NAME})
6 SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
7 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
8 SET(BINDIR "${PREFIX}/bin")
9 SET(DATADIR "${PREFIX}/share")
10 SET(LOCALEDIR "${DATADIR}/locale")
11
12 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
13
14 INCLUDE(FindPkgConfig)
15 SET(PKGS_CHECK_MODULES
16         ail
17         aul
18         capi-system-media-key
19         db-util
20         dlog
21         ecore
22         ecore-evas
23         ecore-input
24         eet
25         eina
26         elementary
27         evas
28         heynoti
29         sysman
30         syspopup-caller
31         vconf
32         appcore-efl
33         glib-2.0
34         ui-gadget-1
35         bundle
36         capi-appfw-application
37         capi-system-info
38         pkgmgr-info)
39
40 IF (with_x)
41         pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES} ecore-x utilX x11 xcomposite xext)
42 ENDIF(with_x)
43
44 IF (with_wayland)
45         ADD_DEFINITIONS("-DWAYLAND")
46         pkg_check_modules(pkgs REQUIRED ${PKGS_CHECK_MODULES})
47 ENDIF(with_wayland)
48
49 FOREACH(flag ${pkgs_CFLAGS})
50         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
51 ENDFOREACH(flag)
52
53 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
54 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
55 SET(CMAKE_C_FLAGS_RELEASE "-O2")
56
57 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")
58
59 FIND_PROGRAM(UNAME NAMES uname)
60 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
61 IF("${ARCH}" STREQUAL "arm")
62         ADD_DEFINITIONS("-DTARGET")
63         MESSAGE("add -DTARGET")
64 ENDIF("${ARCH}" STREQUAL "arm")
65
66 ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
67 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
68 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
69 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
70 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
71 ADD_DEFINITIONS("-D_GNU_SOURCE")
72
73 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
74
75 ADD_EXECUTABLE(${PROJECT_NAME}
76         src/hw_key.c
77         src/pkg_event.c
78         src/menu_daemon.c
79         src/starter.c
80         src/x11.c
81         src/xmonitor.c
82         src/lock-daemon.c
83         src/lockd-debug.c
84         src/lockd-process-mgr.c
85         src/lockd-window-mgr.c
86 )
87 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
88 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
89
90 SET(LOCK_SETTING lock-setting)
91
92 ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${LOCK_SETTING})
93
94 # install desktop file & icon
95 #CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PROJECT_NAME}.desktop)
96 #INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION share/applications)
97
98 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd4starter DESTINATION /etc/init.d
99                 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
100                 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
101 INSTALL(FILES ${CMAKE_SOURCE_DIR}/rd3starter DESTINATION /etc/init.d
102                 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
103                 GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
104 #INSTALL to /etc/init.d