Merge "Updating estimate_gravity implementation for quaternion outputs" into tizen
[platform/core/system/sensord.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 project(sensord_main CXX)
3 include(GNUInstallDirs)
4
5 # Setup For pkgconfig File
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(EXEC_PREFIX "${PREFIX}/bin")
8 SET(LIBDIR "${PREFIX}/${CMAKE_INSTALL_LIBDIR}")
9 SET(INCLUDEDIR "${PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
10 SET(VERSION 1.0)
11
12 # Common Options
13 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O2 -omit-frame-pointer -std=gnu++0x")
14 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections")
15 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-section -Wl,--print-gc-section")
16 MESSAGE("FLAGS: ${CMAKE_CXX_FLAGS}")
17 MESSAGE("FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
18
19 add_definitions(-DUSE_DLOG_LOG)
20 add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}")
21
22 # Internal Debugging Options
23 #add_definitions(-Wall -g -D_DEBUG)
24
25 # For Emulator
26 FIND_PROGRAM(UNAME NAMES uname)
27 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
28 IF("${ARCH}" MATCHES "^arm.*")
29         ADD_DEFINITIONS("-DTARGET")
30         MESSAGE("add -DTARGET")
31 ELSE("${ARCH}" MATCHES "^arm.*")
32         ADD_DEFINITIONS("-DSIMULATOR")
33         MESSAGE("add -DSIMULATOR")
34 ENDIF("${ARCH}" MATCHES "^arm.*")
35
36 # Installing files
37 CONFIGURE_FILE(sensor_plugins.xml.in sensor_plugins.xml @ONLY)
38 CONFIGURE_FILE(sensors.xml.in sensors.xml @ONLY)
39 CONFIGURE_FILE(virtual_sensors.xml.in virtual_sensors.xml @ONLY)
40
41 INSTALL(FILES sensor_plugins.xml sensors.xml DESTINATION etc)
42 INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc)
43 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.APLv2 DESTINATION share/license RENAME sensord)
44 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.APLv2 DESTINATION share/license RENAME libsensord)
45
46 IF("${TEST_SUITE}" STREQUAL "ON")
47 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.APLv2 DESTINATION share/license RENAME test)
48 ENDIF()
49
50 # Sub-directory
51 add_subdirectory(systemd)
52 add_subdirectory(src)
53
54 IF("${TEST_SUITE}" STREQUAL "ON")
55 add_subdirectory(test)
56 ENDIF()
57