summaryrefslogtreecommitdiff
path: root/mobile/CMakeLists.txt
blob: 7d0cd556b7dbfd1514906b7c6a400437ea256a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(starter C)

SET(VENDOR "tizen")
SET(PACKAGE ${PROJECT_NAME})
SET(PKGNAME "org.${VENDOR}.${PACKAGE}")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
SET(DATADIR "${PREFIX}/share")
SET(LOCALEDIR "${DATADIR}/locale")

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
	ail
	aul
	capi-system-media-key
	db-util
	dlog
	ecore
	ecore-evas
	ecore-input
	ecore-x
	eet
	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-system-info
	pkgmgr-info
	libsystemd-daemon
)

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_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${PREFIX}/lib -pie")

FIND_PROGRAM(UNAME NAMES uname)
EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
IF("${ARCH}" STREQUAL "arm")
	ADD_DEFINITIONS("-DTARGET")
	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
)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})

SET(LOCK_SETTING lock-setting)

ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/${LOCK_SETTING})

INSTALL(FILES ${CMAKE_SOURCE_DIR}/starter.rule DESTINATION /opt/etc/smack/accesses.d)

# install desktop file & icon
#CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PROJECT_NAME}.desktop)
#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION share/applications)

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.service DESTINATION /usr/lib/systemd/user)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.socket DESTINATION /usr/lib/systemd/user)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/starter.path DESTINATION /usr/lib/systemd/user)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE.Flora DESTINATION /usr/share/license/starter)