diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b38653c..0ce36492 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ SET(PAHO_BUILD_STATIC FALSE CACHE BOOL "Build static library") SET(PAHO_BUILD_DOCUMENTATION FALSE CACHE BOOL "Create and install the HTML based API documentation (requires Doxygen)") SET(PAHO_BUILD_SAMPLES FALSE CACHE BOOL "Build sample programs") SET(PAHO_BUILD_DEB_PACKAGE FALSE CACHE BOOL "Build debian package") +SET(PAHO_ENABLE_TESTING TRUE CACHE BOOL "Build tests and run") ADD_SUBDIRECTORY(src) IF(PAHO_BUILD_SAMPLES) @@ -76,7 +77,10 @@ SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH}) INCLUDE(CPack) -ENABLE_TESTING() - -INCLUDE_DIRECTORIES(test src) -ADD_SUBDIRECTORY(test) +IF(PAHO_ENABLE_TESTING) + ENABLE_TESTING() + INCLUDE_DIRECTORIES(test src) + ADD_SUBDIRECTORY(test) +ELSE() + INCLUDE_DIRECTORIES(src) +ENDIF() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5c88c44b..3aca80f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT(mqtt-tests) +PROJECT(mqtt-tests C) IF (WIN32) SET(MQTT_TEST_BROKER "tcp://mqtt.iotree.co.uk:1883" CACHE STRING "Hostname of a test MQTT broker to use")