OPTION(ENABLE_DEBUG "Enable Debug" OFF)
# Default features. You may change the features according to your needs.
-OPTION(MQTT_SUPPORT "Enable MQTT" ON)
-OPTION(AITT_SUPPORT "Enable AITT" ON)
+OPTION(MQTT_SUPPORT "Enable MQTT" OFF)
+OPTION(AITT_SUPPORT "Enable AITT" OFF)
IF (NOT DEFINED VERSION)
SET(VERSION 0.1.0)
FIND_LIBRARY(PAHO_MQTT_LIB NAMES paho-mqtt3a paho-mqtt3c paho-mqtt3as paho-mqtt3cs)
IF(NOT PAHO_MQTT_LIB)
- MESSAGE(FATAL_ERROR "Cannot find Paho MQTT library." )
+ MESSAGE(FATAL_ERROR "Cannot find Paho MQTT library.")
ELSE()
MESSAGE("Found Paho MQTT library.")
ENDIF()
IF(AITT_SUPPORT)
FIND_LIBRARY(AITT_LIB NAMES aitt)
IF(NOT AITT_LIB)
- MESSAGE("Cannot find AITT library.")
- SET(AITT_SUPPORT OFF)
+ MESSAGE(FATAL_ERROR "Cannot find AITT library.")
ELSE()
MESSAGE("Found AITT library.")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_AITT=1")
dh $@ --buildsystem=cmake --builddirectory=build --parallel
override_dh_auto_configure:
- dh_auto_configure -- -DCMAKE_INSTALL_LIBDIR=$(EDGE_INSTALL_LIBDIR)
+ dh_auto_configure -- -DCMAKE_INSTALL_LIBDIR=$(EDGE_INSTALL_LIBDIR) -DMQTT_SUPPORT=ON
%define enable_unittest -DENABLE_TEST=OFF
%endif
+%if 0%{?mqtt_support}
+%define enable_mqtt -DMQTT_SUPPORT=ON
+%else
+%define enable_mqtt -DMQTT_SUPPORT=OFF
+%endif
+
+%if 0%{?aitt_support}
+%define enable_aitt -DAITT_SUPPORT=ON
+%else
+%define enable_aitt -DAITT_SUPPORT=OFF
+%endif
+
%prep
%setup -q
cp %{SOURCE1001} .
pushd build
%cmake .. \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DVERSION=%{version} %{enable_unittest}
+ -DVERSION=%{version} \
+ %{enable_unittest} %{enable_mqtt} %{enable_aitt}
make %{?jobs:-j%jobs}
popd