summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 486bca070d6f492ac9521f2799d5a7a0264f2234 (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(feedback C)

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(VERSION 0.1.4)

SET(COMMON_PROFILE "common")
SET(MOBILE_PROFILE "mobile")
SET(WEARABLE_PROFILE "wearable")

SET(SRCS
	src/sound.c
	src/vibrator.c
	src/devices.c
	src/parser.c
	src/feedback.c
	src/dbus.c
	src/check.c)

SET(HEADERS
	include/feedback.h
	include/feedback-ids.h
	include/feedback-internal.h
	include/feedback-ids-internal.h)

ADD_DEFINITIONS("-DFEEDBACK_SYS_SHARE=\"${TZ_SYS_SHARE}\"")
ADD_DEFINITIONS("-DFEEDBACK_SYS_RO_SHARE=\"${TZ_SYS_RO_SHARE}\"")

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED vconf mm-keysound dlog glib-2.0 dbus-1 gio-2.0 capi-system-info)

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

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)

CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

INSTALL(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${COMMON_PROFILE}/data/ DESTINATION share/${COMMON_PROFILE})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${MOBILE_PROFILE}/data/ DESTINATION share/${MOBILE_PROFILE})
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${WEARABLE_PROFILE}/data/ DESTINATION share/${WEARABLE_PROFILE})