CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(sensors CXX) INCLUDE(GNUInstallDirs) SET(HRM "OFF") SET(HRM_VIRT "OFF") SET(AUTO_ROTATION "ON") SET(GRAVITY "OFF") SET(LINEAR_ACCEL "OFF") SET(ORIENTATION "OFF") SET(FUSION "OFF") SET(MOTION "OFF") SET(RV "OFF") INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/shared ${CMAKE_SOURCE_DIR}/src/server ${CMAKE_CURRENT_SOURCE_DIR} ) FILE(GLOB SENSOR_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB_RECURSE SENSOR_SRCS ${SENSOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/accel/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/accel) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} "-DENABLE_ACCEL") IF("${HRM}" STREQUAL "ON") FILE(GLOB_RECURSE SENSOR_SRCS ${SENSOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/hrm/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/hrm) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} "-DENABLE_HRM") ENDIF() IF("${HRM_VIRT}" STREQUAL "ON") add_subdirectory(hrm_virt) ENDIF() IF("${AUTO_ROTATION}" STREQUAL "ON") FILE(GLOB_RECURSE SENSOR_SRCS ${SENSOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/auto_rotation) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} "-DENABLE_AUTO_ROTATION") ENDIF() IF("${GRAVITY}" STREQUAL "ON") FILE(GLOB_RECURSE SENSOR_SRCS ${SENSOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/gravity/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/gravity) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} "-DENABLE_GRAVITY") ENDIF() IF("${LINEAR_ACCEL}" STREQUAL "ON") FILE(GLOB_RECURSE SENSOR_SRCS ${SENSOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/linear_accel/*.cpp) SET(SENSOR_HEADERS ${SENSOR_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/linear_accel) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} "-DENABLE_LINEAR_ACCEL") ENDIF() IF("${ORIENTATION}" STREQUAL "ON") add_subdirectory(orientation) ENDIF() IF("${RV}" STREQUAL "ON") add_subdirectory(rotation_vector) ENDIF() IF("${FUSION}" STREQUAL "ON") add_subdirectory(fusion) ENDIF() IF("${MOTION}" STREQUAL "ON") add_subdirectory(motion) ENDIF() MESSAGE("${SENSOR_SRCS}") SET(SENSOR_SRCS ${SENSOR_SRCS} PARENT_SCOPE) SET(SENSOR_HEADERS ${SENSOR_HEADERS} PARENT_SCOPE) SET(SENSOR_DEFINITIONS ${SENSOR_DEFINITIONS} PARENT_SCOPE) # Installing files INSTALL(FILES virtual_sensors.xml virtual_sensors.xml DESTINATION etc)