Label test project as C; add flag to disable test build & run #331

This commit is contained in:
Ian Craggs 2017-09-20 16:06:23 +01:00
parent f32842c56b
commit a87450ebce
2 changed files with 9 additions and 5 deletions

View File

@ -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()

View File

@ -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")