summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 421e8048bfe661fdadea4e655a32541f33d4f4de (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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(${P_NAME} C)

SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
SET(CMAKE_VERBOSE_MAKEFILE 0)

SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res")

INCLUDE(FindPkgConfig)
pkg_check_modules(APP_PKGS REQUIRED
	dlog
	capi-appfw-application
	capi-ui-efl-util
	elementary
	efl-extension
	capi-system-sensor
)

FOREACH (flag ${APP_PKGS_CFLAGS})
    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")

INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc)

ADD_EXECUTABLE(${PROJECT_NAME}
	${PROJECT_ROOT_DIR}/src/app.c
	${PROJECT_ROOT_DIR}/src/communication_center.c
	${PROJECT_ROOT_DIR}/src/communication_by_udp.c
	${PROJECT_ROOT_DIR}/src/view.c
	${PROJECT_ROOT_DIR}/src/resource.c
	${PROJECT_ROOT_DIR}/src/resource_accelerometer.c
)

ADD_CUSTOM_COMMAND(OUTPUT app.edj
	COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images/
	${CMAKE_SOURCE_DIR}/res/edje/app.edc ${CMAKE_BINARY_DIR}/app.edj
	DEPENDS ${CMAKE_SOURCE_DIR}/res/edje/app.edc
)

ADD_CUSTOM_TARGET(edj_build DEPENDS app.edj)
ADD_DEPENDENCIES(${PROJECT_NAME} edj_build)

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${APP_PKGS_LDFLAGS})

CONFIGURE_FILE(${PROJECT_ROOT_DIR}/tizen-manifest.xml.in ${ORG_PREFIX}.${PROJECT_NAME}.xml @ONLY)
# Install
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX})
INSTALL(FILES ${ORG_PREFIX}.${PROJECT_NAME}.xml DESTINATION ${SYS_PACKAGES_DIR})
INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/default_icon.png DESTINATION ${SYS_ICONS_DIR} RENAME ${PROJECT_NAME}.png)
INSTALL(FILES ${CMAKE_BINARY_DIR}/app.edj DESTINATION /usr/apps/${ORG_PREFIX}.${PROJECT_NAME}/res/edje)

# End of a file