Moving hal files to new repo and updating CMakeLists and spec file
[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 # Installing files
26 CONFIGURE_FILE(sensor_plugins.xml.in sensor_plugins.xml @ONLY)
27
28 INSTALL(FILES sensor_plugins.xml DESTINATION etc)
29 INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc)
30
31 # Sub-directory
32 add_subdirectory(systemd)
33 add_subdirectory(src)
34
35 IF("${TEST_SUITE}" STREQUAL "ON")
36 add_subdirectory(test)
37 ENDIF()
38