55 lines
1.1 KiB
CMake
55 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(imsensors)
|
|
|
|
option(IMSENSORS_FLOAT_SUPPORT "Enable floating point support" OFF)
|
|
|
|
set(IMSENSORS_SRCS
|
|
"src/als/als_ltr_303als.c"
|
|
"src/dht/dht_aht10.c"
|
|
"src/dht/dht_bme280.c"
|
|
"src/franklin/franklin_as3935.c"
|
|
"src/imu/imu_lsm6dsl.c"
|
|
"src/magnetic/magnetic_bmm150.c"
|
|
"src/ppg/ppg_pah8001.c"
|
|
"src/touch/tp_it7259.c"
|
|
)
|
|
|
|
set(IMSENSORS_INCS
|
|
"include/imsensors/common"
|
|
"include/imsensors/als"
|
|
"include/imsensors/dht"
|
|
"include/imsensors/franklin"
|
|
"include/imsensors/imu"
|
|
"include/imsensors/magnetic"
|
|
"include/imsensors/ppg"
|
|
"include/imsensors/touch"
|
|
)
|
|
|
|
set(IMSENSORS_INTF_INCS
|
|
"include"
|
|
)
|
|
|
|
set(IMSENSORS_DEFS
|
|
|
|
)
|
|
|
|
set(IMSENSORS_FLOAT_DEFS
|
|
"IMS_CFG_DHT_BME280_ENABLE_FLOAT"
|
|
"IMS_CFG_DHT_AHT10_ENABLE_FLOAT"
|
|
)
|
|
|
|
add_library(${PROJECT_NAME} ${IMSENSORS_SRCS})
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
PRIVATE ${IMSENSORS_INCS}
|
|
PUBLIC ${IMSENSORS_INTF_INCS}
|
|
)
|
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
PRIVATE ${IMSENSORS_DEFS}
|
|
)
|
|
|
|
if(IMSENSORS_FLOAT_SUPPORT)
|
|
target_compile_definitions(${PROJECT_NAME} PUBLIC ${IMSENSORS_FLOAT_DEFS})
|
|
endif() |