Refactoring sensord build files
[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 INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc)
27
28 # Sub-directory
29 add_subdirectory(systemd)
30 add_subdirectory(src)
31
32 IF("${TEST_SUITE}" STREQUAL "ON")
33 add_subdirectory(test)
34 ENDIF()
35