CMake check for required header for SPI connection
@@ -8,12 +8,14 @@ set(CONNECTION_SPI_SOURCES
${THIS_SOURCE_DIR}/ConnectionSPI.cpp
)
+CHECK_INCLUDE_FILE("wiringPi.h" HAS_WIRING_HEADER)
+
########################################################################
## Feature registration
########################################################################
include(FeatureSummary)
include(CMakeDependentOption)
-cmake_dependent_option(ENABLE_SPI "Enable SPI connection" OFF "ENABLE_LIBRARY" OFF)
+cmake_dependent_option(ENABLE_SPI "Enable SPI connection" OFF "ENABLE_LIBRARY;HAS_WIRING_HEADER" OFF)
add_feature_info(ConnectionSPI ENABLE_SPI "Rasp Pi 3 SPI Connection support")
if (NOT ENABLE_SPI)
return()
