1 cmake_minimum_required(VERSION 2.6)
2 project(sensord_main CXX)
3 include(GNUInstallDirs)
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}")
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}")
19 add_definitions(-DUSE_DLOG_LOG)
20 add_definitions(-DLIBDIR="${CMAKE_INSTALL_LIBDIR}")
22 # Internal Debugging Options
23 #add_definitions(-Wall -g -D_DEBUG)
26 INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc)
29 add_subdirectory(systemd)
32 IF("${TEST_SUITE}" STREQUAL "ON")
33 add_subdirectory(test)