From d72a6d077c53d2ad8010e8da4df1b87ab5cc88d7 Mon Sep 17 00:00:00 2001 From: Ian Craggs <10279016+icraggs@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:15:41 +0100 Subject: [PATCH] Merge pull request #1428 from fpagliughi/cmake-update CMake cleanup, bump to v3.5, and submodule improvements --- CMakeLists.txt | 209 +++-- doc/CMakeLists.txt | 53 +- src/CMakeLists.txt | 642 ++++++++------ src/VersionInfo.h.in | 12 +- src/samples/CMakeLists.txt | 151 ++-- test/CMakeLists.txt | 1640 +++++++++++++++-------------------- test_package/CMakeLists.txt | 2 +- version.minor | 2 +- version.patch | 2 +- 9 files changed, 1309 insertions(+), 1404 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf0fd68bd..210fa383d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ #******************************************************************************* -# Copyright (c) 2015, 2020 logi.cals GmbH and others +# Copyright (c) 2015, 2023 logi.cals GmbH, Frank Pagliughi and others # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 @@ -15,107 +15,128 @@ # Genis Riera Perez - Add support for building debian package #*******************************************************************************/ -# Note: on OS X you should install XCode and the associated command-line tools +cmake_minimum_required(VERSION 3.5) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12) -PROJECT("Eclipse Paho C" C) -MESSAGE(STATUS "CMake version: " ${CMAKE_VERSION}) -MESSAGE(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME}) +project("Eclipse Paho C" + VERSION 1.4.0 + LANGUAGES C +) -SET(CMAKE_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake") -SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") +message(STATUS "CMake version: " ${CMAKE_VERSION}) +message(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME}) -## build settings +set(CMAKE_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake") +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") + +## Project Version +## Previously we read in the version from these files, but now we use the +## CMake project setting. We just make sure the files and CMake match. file(READ version.major PAHO_VERSION_MAJOR) file(READ version.minor PAHO_VERSION_MINOR) file(READ version.patch PAHO_VERSION_PATCH) -SET(CLIENT_VERSION ${PAHO_VERSION_MAJOR}.${PAHO_VERSION_MINOR}.${PAHO_VERSION_PATCH}) +set(CLIENT_VERSION ${PAHO_VERSION_MAJOR}.${PAHO_VERSION_MINOR}.${PAHO_VERSION_PATCH}) + +if(NOT (CLIENT_VERSION VERSION_EQUAL PROJECT_VERSION)) + message(FATAL_ERROR "CMake project version does NOT match. CMake: ${PROJECT_VERSION}, Files: ${CLIENT_VERSION}") +endif() -INCLUDE(GNUInstallDirs) +include(GNUInstallDirs) -STRING(TIMESTAMP BUILD_TIMESTAMP UTC) -MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}") +string(TIMESTAMP BUILD_TIMESTAMP UTC) +message(STATUS "Timestamp is ${BUILD_TIMESTAMP}") -IF(WIN32) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) -ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - ADD_DEFINITIONS(-DOSX) -ENDIF() +if(WIN32) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN) +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + add_definitions(-DOSX) +endif() ## build options -SET(PAHO_WITH_SSL FALSE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ") -SET(PAHO_BUILD_SHARED TRUE CACHE BOOL "Build shared library") -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") -SET(PAHO_ENABLE_CPACK TRUE CACHE BOOL "Enable CPack") -SET(PAHO_HIGH_PERFORMANCE FALSE CACHE BOOL "Disable tracing and heap tracking") -SET(PAHO_USE_SELECT FALSE CACHE BOOL "Revert to select system call instead of poll") - -IF (PAHO_HIGH_PERFORMANCE) - ADD_DEFINITIONS(-DHIGH_PERFORMANCE=1) -ENDIF() - -IF (PAHO_USE_SELECT) - ADD_DEFINITIONS(-DUSE_SELECT=1) -ENDIF() - -IF (NOT PAHO_BUILD_SHARED AND NOT PAHO_BUILD_STATIC) - MESSAGE(FATAL_ERROR "You must set either PAHO_BUILD_SHARED, PAHO_BUILD_STATIC, or both") -ENDIF() - -IF(PAHO_BUILD_DEB_PACKAGE) - set(CMAKE_INSTALL_DOCDIR share/doc/libpaho-mqtt) - set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) - set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") -ENDIF() - -ADD_SUBDIRECTORY(src) -IF(PAHO_BUILD_SAMPLES) - ADD_SUBDIRECTORY(src/samples) -ENDIF() - -IF(PAHO_BUILD_DOCUMENTATION) - ADD_SUBDIRECTORY(doc) -ENDIF() - -IF (PAHO_ENABLE_CPACK) - ### packaging settings - FILE(GLOB samples "src/samples/*.c") - INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}/samples) - - SET(CPACK_PACKAGE_VENDOR "Eclipse Paho") - SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") - INSTALL(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) - - IF (WIN32) - SET(CPACK_GENERATOR "ZIP") - ELSEIF(PAHO_BUILD_DEB_PACKAGE) - INSTALL(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) - - SET(CPACK_GENERATOR "DEB") - CONFIGURE_FILE(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in - ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY) - SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake) - ELSE() - SET(CPACK_GENERATOR "TGZ") - ENDIF() -ELSE() - FILE(GLOB samples "src/samples/*.c") - INSTALL(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}) -ENDIF() - -SET(CPACK_PACKAGE_VERSION_MAJOR ${PAHO_VERSION_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH}) -INCLUDE(CPack) - -IF(PAHO_ENABLE_TESTING) - ENABLE_TESTING() - INCLUDE_DIRECTORIES(test src) - ADD_SUBDIRECTORY(test) -ELSE() - INCLUDE_DIRECTORIES(src) -ENDIF() +option(PAHO_WITH_SSL "Flag that defines whether to build ssl-enabled binaries too. " FALSE) +option(PAHO_WITH_LIBUUID "Flag that defines whether libuuid or a custom uuid implementation should be used" FALSE) +option(PAHO_BUILD_SHARED "Build shared library" TRUE) +option(PAHO_BUILD_STATIC "Build static library" FALSE) +option(PAHO_BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" FALSE) +option(PAHO_BUILD_SAMPLES "Build sample programs" FALSE) +option(PAHO_BUILD_DEB_PACKAGE "Build debian package" FALSE) +option(PAHO_ENABLE_TESTING "Build tests and run" TRUE) +option(PAHO_ENABLE_CPACK "Enable CPack" TRUE) +option(PAHO_HIGH_PERFORMANCE "Disable tracing and heap tracking" FALSE) +option(PAHO_USE_SELECT "Revert to select system call instead of poll" FALSE) + +if(PAHO_HIGH_PERFORMANCE) + add_definitions(-DHIGH_PERFORMANCE=1) +endif() + +if(PAHO_USE_SELECT) + add_definitions(-DUSE_SELECT=1) +endif() + +if(PAHO_WITH_LIBUUID) + add_definitions(-DUSE_LIBUUID=1) +endif() + +if(NOT PAHO_BUILD_SHARED AND NOT PAHO_BUILD_STATIC) + message(FATAL_ERROR "You must set either PAHO_BUILD_SHARED, PAHO_BUILD_STATIC, or both") +endif() + +if(PAHO_BUILD_SAMPLES AND NOT PAHO_WITH_SSL) + message(WARNING "You must build with SSL to build the full set of samples") +endif() + +if(PAHO_BUILD_DEB_PACKAGE) + set(CMAKE_INSTALL_DOCDIR share/doc/libpaho-mqtt) + set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) + set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=") +endif() + +add_subdirectory(src) + +if(PAHO_BUILD_SAMPLES) + add_subdirectory(src/samples) +endif() + +if(PAHO_BUILD_DOCUMENTATION) + add_subdirectory(doc) +endif() + +if(PAHO_ENABLE_CPACK) + ### packaging settings + file(GLOB samples "src/samples/*.c") + install(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}/samples) + + set(CPACK_PACKAGE_VENDOR "Eclipse Paho") + set(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") + install(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) + + if(WIN32) + set(CPACK_GENERATOR "ZIP") + elseif(PAHO_BUILD_DEB_PACKAGE) + install(FILES CONTRIBUTING.md epl-v20 edl-v10 README.md notice.html DESTINATION ${CMAKE_INSTALL_DOCDIR}) + + set(CPACK_GENERATOR "DEB") + configure_file(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in + ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY + ) + set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake) + else() + set(CPACK_GENERATOR "TGZ") + endif() +else() + file(GLOB samples "src/samples/*.c") + install(FILES ${samples} DESTINATION ${CMAKE_INSTALL_DOCDIR}) +endif() + +set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +include(CPack) + +if(PAHO_ENABLE_TESTING) + enable_testing() + include_directories(test src) + add_subdirectory(test) +else() + include_directories(src) +endif() diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1822995a5..7a82a5b4c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -14,32 +14,33 @@ # Rainer Poisel - initial version #*******************************************************************************/ -# Note: on OS X you should install XCode and the associated command-line tools - ### documentation settings -FIND_PACKAGE(Doxygen) -IF(NOT DOXYGEN_FOUND) - message(FATAL_ERROR "Doxygen is needed to build the documentation.") -ENDIF() -SET(DOXYTARGETS) -FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) -FOREACH(DOXYFILE_SRC DoxyfileV3ClientAPI;DoxyfileV3AsyncAPI;DoxyfileV3ClientInternal) - SET(DOXYFILE_IN ${DOXYFILE_SRC}.in) - SET(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYFILE_SRC}) +find_package(Doxygen) +if(NOT DOXYGEN_FOUND) + message(FATAL_ERROR "Doxygen is needed to build the documentation.") +endif() + +set(DOXYTARGETS) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) + +foreach(DOXYFILE_SRC DoxyfileV3ClientAPI;DoxyfileV3AsyncAPI;DoxyfileV3ClientInternal) + set(DOXYFILE_IN ${DOXYFILE_SRC}.in) + set(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYFILE_SRC}) + + configure_file(${DOXYFILE_IN} ${DOXYFILE} @ONLY) + add_custom_target(${DOXYFILE_SRC}.target + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM + ) + set(DOXYTARGETS ${DOXYTARGETS} ${DOXYFILE_SRC}.target) +endforeach(DOXYFILE_SRC) - CONFIGURE_FILE(${DOXYFILE_IN} ${DOXYFILE} @ONLY) - ADD_CUSTOM_TARGET(${DOXYFILE_SRC}.target - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM - ) - SET(DOXYTARGETS ${DOXYTARGETS} ${DOXYFILE_SRC}.target) -ENDFOREACH(DOXYFILE_SRC) +add_custom_target(doc ALL DEPENDS ${DOXYTARGETS}) -ADD_CUSTOM_TARGET(doc ALL DEPENDS ${DOXYTARGETS}) -IF (PAHO_ENABLE_CPACK) - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR}) -ELSE() - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_DOCDIR}) -ENDIF() +if(PAHO_ENABLE_CPACK) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR}) +else() + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_DOCDIR}) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 156e5e4bb..65ad6217b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ #******************************************************************************* -# Copyright (c) 2015, 2022 logi.cals GmbH and others +# Copyright (c) 2015, 2023 logi.cals GmbH, Frank Pagliughi and others # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 @@ -16,16 +16,14 @@ # Ian Craggs - update for MQTTV5 support #*******************************************************************************/ -# Note: on OS X you should install XCode and the associated command-line tools - ## compilation/linkage settings -CONFIGURE_FILE(VersionInfo.h.in - ${CMAKE_BINARY_DIR}/VersionInfo.h - @ONLY - ) +configure_file(VersionInfo.h.in + ${CMAKE_BINARY_DIR}/VersionInfo.h + @ONLY +) -SET(common_src +set(common_src MQTTTime.c MQTTProtocolClient.c Clients.c @@ -50,287 +48,369 @@ SET(common_src Proxy.c ) -IF (NOT PAHO_HIGH_PERFORMANCE) - SET(common_src ${common_src} +if(NOT PAHO_HIGH_PERFORMANCE) + set(common_src ${common_src} StackTrace.c Heap.c - ) -ENDIF() - -IF (WIN32) - SET(LIBS_SYSTEM ws2_32 crypt32 RpcRT4 Iphlpapi) -ELSEIF (UNIX) - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(LIBS_SYSTEM c dl pthread rt) - # anl is only available with glibc so check if it is found before using - # it or build will fail on uclibc or musl - FIND_LIBRARY(LIB_ANL anl) - IF(LIB_ANL) - SET(LIBS_SYSTEM "${LIBS_SYSTEM}" anl) - ENDIF() - ADD_DEFINITIONS(-D_GNU_SOURCE -fvisibility=hidden) - ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Android") - SET(LIBS_SYSTEM c dl) - ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - SET(LIBS_SYSTEM compat pthread) - ELSE() - SET(LIBS_SYSTEM c pthread) - ENDIF() -ENDIF() - -IF (PAHO_BUILD_SHARED) -# common compilation for libpaho-mqtt3c and libpaho-mqtt3a -ADD_LIBRARY(common_obj OBJECT ${common_src}) -SET_TARGET_PROPERTIES(common_obj PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") -ADD_EXECUTABLE(MQTTVersion MQTTVersion.c) -SET_TARGET_PROPERTIES(MQTTVersion PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1") -ENDIF() - -IF (PAHO_BUILD_STATIC) -ADD_LIBRARY(common_obj_static OBJECT ${common_src}) -SET_TARGET_PROPERTIES(common_obj_static PROPERTIES - POSITION_INDEPENDENT_CODE ON - COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") -ENDIF() - -IF (PAHO_BUILD_SHARED) - ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) - ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c MQTTAsyncUtils.c) - - TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) - TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) - TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM}) - - SET_TARGET_PROPERTIES( - paho-mqtt3c paho-mqtt3a PROPERTIES - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1") - - IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) - ELSEIF (NOT WIN32) - SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) - ENDIF() - - IF (NOT WIN32) - SET_TARGET_PROPERTIES( - paho-mqtt3c PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") - SET_TARGET_PROPERTIES( - paho-mqtt3a PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") - ENDIF() - - FOREACH(TARGET paho-mqtt3c paho-mqtt3a) - TARGET_INCLUDE_DIRECTORIES(${TARGET} - PUBLIC - $ - $ - PRIVATE - ${CMAKE_BINARY_DIR}) - ENDFOREACH() + ) +endif() + +if(WIN32) + set(LIBS_SYSTEM ws2_32 crypt32 RpcRT4) +elseif(UNIX) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(LIBS_SYSTEM c dl pthread rt) + # anl is only available with glibc so check if it is found before using + # it or build will fail on uclibc or musl + find_library(LIB_ANL anl) + if(LIB_ANL) + set(LIBS_SYSTEM "${LIBS_SYSTEM}" anl) + endif() + if(PAHO_WITH_LIBUUID) + set(LIBS_SYSTEM "${LIBS_SYSTEM}" uuid) + endif() + add_definitions(-D_GNU_SOURCE -fvisibility=hidden) + elseif(CMAKE_SYSTEM_NAME MATCHES "Android") + set(LIBS_SYSTEM c dl) + elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(LIBS_SYSTEM compat pthread) + else() + set(LIBS_SYSTEM c pthread) + endif() +endif() + +if(PAHO_BUILD_SHARED) + # common compilation for libpaho-mqtt3c and libpaho-mqtt3a + add_library(common_obj OBJECT ${common_src}) + set_target_properties(common_obj PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_compile_definitions(common_obj PRIVATE PAHO_MQTT_EXPORTS=1) + + add_executable(MQTTVersion MQTTVersion.c) + target_compile_definitions(MQTTVersion PUBLIC PAHO_MQTT_IMPORTS=1) +endif() + +if(PAHO_BUILD_STATIC) + add_library(common_obj_static OBJECT ${common_src}) + set_target_properties(common_obj_static PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_compile_definitions(common_obj_static PRIVATE PAHO_MQTT_STATIC=1) +endif() + +if(PAHO_BUILD_SHARED) + add_library(paho-mqtt3c SHARED + $ + MQTTClient.c + ) + add_library(paho-mqtt3a SHARED + $ + MQTTAsync.c + MQTTAsyncUtils.c + ) + + add_library(eclipse-paho-mqtt-c::paho-mqtt3c ALIAS paho-mqtt3c) + add_library(eclipse-paho-mqtt-c::paho-mqtt3a ALIAS paho-mqtt3a) - INSTALL(TARGETS paho-mqtt3c paho-mqtt3a - EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - INSTALL(TARGETS MQTTVersion - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -ENDIF() - -IF (PAHO_BUILD_STATIC) - ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) - ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c) - - TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) - TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) - IF (NOT WIN32) - SET_TARGET_PROPERTIES(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) - SET_TARGET_PROPERTIES(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) - ENDIF() - SET_TARGET_PROPERTIES( - paho-mqtt3c-static paho-mqtt3a-static PROPERTIES - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1") - - FOREACH(TARGET paho-mqtt3c-static paho-mqtt3a-static) - TARGET_INCLUDE_DIRECTORIES(${TARGET} - PUBLIC - $ - $ - PRIVATE - ${CMAKE_BINARY_DIR}) - ENDFOREACH() - - IF (NOT PAHO_BUILD_SHARED) - INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static - EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - ELSE() - INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF() -ENDIF() - -INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h MQTTExportDeclarations.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - -IF (PAHO_WITH_SSL) - SET(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes") - find_package(OpenSSL REQUIRED) - - IF (PAHO_BUILD_SHARED) - ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as - ## Note: SSL libraries must be recompiled due ifdefs - ADD_LIBRARY(common_ssl_obj OBJECT ${common_src}) - TARGET_INCLUDE_DIRECTORIES(common_ssl_obj PUBLIC ${OPENSSL_INCLUDE_DIR}) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") + target_link_libraries(paho-mqtt3c ${LIBS_SYSTEM}) + target_link_libraries(paho-mqtt3a ${LIBS_SYSTEM}) + target_link_libraries(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM}) - ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) - ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) + set_target_properties(paho-mqtt3c paho-mqtt3a PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + COMPILE_DEFINITIONS "PAHO_MQTT_EXPORTS=1" + ) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) + elseif(NOT WIN32) + set(MQTTCLIENT_ENTRY_POINT MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT MQTTAsync_init) + endif() + + if(NOT WIN32) + set_target_properties(paho-mqtt3c PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}" + ) + set_target_properties(paho-mqtt3a PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}" + ) + endif() + + foreach(TARGET paho-mqtt3c paho-mqtt3a) + target_include_directories(${TARGET} + PUBLIC + $ + $ + PRIVATE + ${CMAKE_BINARY_DIR}) + endforeach() + + install(TARGETS paho-mqtt3c paho-mqtt3a + EXPORT eclipse-paho-mqtt-cTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + + install(TARGETS MQTTVersion + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +endif() + +if(PAHO_BUILD_STATIC) + add_library(paho-mqtt3c-static STATIC + $ + MQTTClient.c + ) + add_library(paho-mqtt3a-static STATIC + $ + MQTTAsync.c + MQTTAsyncUtils.c + ) + + add_library(eclipse-paho-mqtt-c::paho-mqtt3c-static ALIAS paho-mqtt3c-static) + add_library(eclipse-paho-mqtt-c::paho-mqtt3a-static ALIAS paho-mqtt3a-static) + + target_link_libraries(paho-mqtt3c-static ${LIBS_SYSTEM}) + target_link_libraries(paho-mqtt3a-static ${LIBS_SYSTEM}) + + if(NOT WIN32) + set_target_properties(paho-mqtt3c-static PROPERTIES OUTPUT_NAME paho-mqtt3c) + set_target_properties(paho-mqtt3a-static PROPERTIES OUTPUT_NAME paho-mqtt3a) + endif() + + set_target_properties(paho-mqtt3c-static paho-mqtt3a-static PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + COMPILE_DEFINITIONS "PAHO_MQTT_STATIC=1" + ) + + foreach(TARGET paho-mqtt3c-static paho-mqtt3a-static) + target_include_directories(${TARGET} + PUBLIC + $ + $ + PRIVATE + ${CMAKE_BINARY_DIR}) + endforeach() + + if(NOT PAHO_BUILD_SHARED) + install(TARGETS paho-mqtt3c-static paho-mqtt3a-static + EXPORT eclipse-paho-mqtt-cTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + else() + install(TARGETS paho-mqtt3c-static paho-mqtt3a-static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif() +endif() + +install( + FILES + MQTTAsync.h + MQTTClient.h + MQTTClientPersistence.h + MQTTProperties.h + MQTTReasonCodes.h + MQTTSubscribeOpts.h + MQTTExportDeclarations.h + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR} +) + +if(PAHO_WITH_SSL) + set(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes") + find_package(OpenSSL REQUIRED) + + if(PAHO_BUILD_SHARED) + ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as + ## Note: SSL libraries must be recompiled due to ifdefs + add_library(common_ssl_obj OBJECT ${common_src}) + target_include_directories(common_ssl_obj PUBLIC ${OPENSSL_INCLUDE_DIR}) + + set_property(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON) + target_compile_definitions(common_ssl_obj PRIVATE OPENSSL=1 PAHO_MQTT_EXPORTS=1) - SET_TARGET_PROPERTIES( - paho-mqtt3cs paho-mqtt3as PROPERTIES - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1") - - IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) - ELSEIF (NOT WIN32) - SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) - ENDIF() - - IF (NOT WIN32) - SET_TARGET_PROPERTIES( - paho-mqtt3cs PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") - SET_TARGET_PROPERTIES( - paho-mqtt3as PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") - ENDIF() - - FOREACH(TARGET paho-mqtt3cs paho-mqtt3as) - TARGET_INCLUDE_DIRECTORIES(${TARGET} - PUBLIC - $ - $ - PRIVATE - ${CMAKE_BINARY_DIR}) - TARGET_LINK_LIBRARIES(${TARGET} - PUBLIC - OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) - ENDFOREACH() - INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as - EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - ENDIF() - - IF (PAHO_BUILD_STATIC) - ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as - ## Note: SSL libraries must be recompiled due ifdefs - ADD_LIBRARY(common_ssl_obj_static OBJECT ${common_src}) - TARGET_INCLUDE_DIRECTORIES(common_ssl_obj_static PUBLIC ${OPENSSL_INCLUDE_DIR}) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj_static PROPERTY COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") + add_library(paho-mqtt3cs SHARED + $ + MQTTClient.c + SSLSocket.c + ) + add_library(paho-mqtt3as SHARED + $ + MQTTAsync.c + MQTTAsyncUtils.c + SSLSocket.c + ) + + add_library(eclipse-paho-mqtt-c::paho-mqtt3cs ALIAS paho-mqtt3cs) + add_library(eclipse-paho-mqtt-c::paho-mqtt3as ALIAS paho-mqtt3as) + + set_target_properties(paho-mqtt3cs paho-mqtt3as PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_EXPORTS=1" + ) + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) + elseif(NOT WIN32) + set(MQTTCLIENT_ENTRY_POINT MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT MQTTAsync_init) + endif() + + if(NOT WIN32) + set_target_properties(paho-mqtt3cs PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}" + ) + set_target_properties(paho-mqtt3as PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") + endif() + + foreach(TARGET paho-mqtt3cs paho-mqtt3as) + target_include_directories(${TARGET} + PUBLIC + $ + $ + PRIVATE + ${CMAKE_BINARY_DIR} + ) + target_link_libraries(${TARGET} + PUBLIC + OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM} + ) + endforeach() + + install(TARGETS paho-mqtt3cs paho-mqtt3as + EXPORT eclipse-paho-mqtt-cTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif() + + if(PAHO_BUILD_STATIC) + ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as + ## Note: SSL libraries must be recompiled due ifdefs + add_library(common_ssl_obj_static OBJECT ${common_src}) + target_include_directories(common_ssl_obj_static PUBLIC ${OPENSSL_INCLUDE_DIR}) + + set_property(TARGET common_ssl_obj_static PROPERTY POSITION_INDEPENDENT_CODE ON) + target_compile_definitions(common_ssl_obj_static PRIVATE OPENSSL=1 PAHO_MQTT_STATIC=1) - ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) - ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c MQTTAsyncUtils.c SSLSocket.c) - - SET_TARGET_PROPERTIES( - paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1") - IF (NOT WIN32) - SET_TARGET_PROPERTIES(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) - SET_TARGET_PROPERTIES(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) - ENDIF() - - IF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - SET(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) - ELSEIF (NOT WIN32) - SET(MQTTCLIENT_ENTRY_POINT MQTTClient_init) - SET(MQTTASYNC_ENTRY_POINT MQTTAsync_init) - ENDIF() - - IF (NOT WIN32) - SET_TARGET_PROPERTIES( - paho-mqtt3cs-static PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}") - SET_TARGET_PROPERTIES( - paho-mqtt3as-static PROPERTIES - LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}") - ENDIF() - - IF (NOT PAHO_BUILD_SHARED) - INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static - EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - ELSE() - INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF() - FOREACH(TARGET paho-mqtt3cs-static paho-mqtt3as-static) - TARGET_INCLUDE_DIRECTORIES(${TARGET} - PUBLIC - $ - $ - PRIVATE - ${CMAKE_BINARY_DIR}) - TARGET_LINK_LIBRARIES(${TARGET} - PUBLIC - OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM}) - ENDFOREACH() - ENDIF() -ENDIF() - -INSTALL(EXPORT eclipse-paho-mqtt-cTargets - FILE eclipse-paho-mqtt-cConfig.cmake - NAMESPACE eclipse-paho-mqtt-c:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/eclipse-paho-mqtt-c) - -INCLUDE(CMakePackageConfigHelpers) -WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" - VERSION ${CLIENT_VERSION} - COMPATIBILITY SameMajorVersion) -INSTALL(FILES + add_library(paho-mqtt3cs-static STATIC + $ + MQTTClient.c + SSLSocket.c + ) + add_library(paho-mqtt3as-static STATIC + $ + MQTTAsync.c + MQTTAsyncUtils.c + SSLSocket.c + ) + + add_library(eclipse-paho-mqtt-c::paho-mqtt3cs-static ALIAS paho-mqtt3cs-static) + add_library(eclipse-paho-mqtt-c::paho-mqtt3as-static ALIAS paho-mqtt3as-static) + + set_target_properties(paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + COMPILE_DEFINITIONS "OPENSSL=1;PAHO_MQTT_STATIC=1" + ) + + if(NOT WIN32) + set_target_properties(paho-mqtt3cs-static PROPERTIES OUTPUT_NAME paho-mqtt3cs) + set_target_properties(paho-mqtt3as-static PROPERTIES OUTPUT_NAME paho-mqtt3as) + endif() + + if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(MQTTCLIENT_ENTRY_POINT _MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT _MQTTAsync_init) + elseif(NOT WIN32) + set(MQTTCLIENT_ENTRY_POINT MQTTClient_init) + set(MQTTASYNC_ENTRY_POINT MQTTAsync_init) + endif() + + if(NOT WIN32) + set_target_properties(paho-mqtt3cs-static PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTCLIENT_ENTRY_POINT}" + ) + set_target_properties(paho-mqtt3as-static PROPERTIES + LINK_FLAGS "-Wl,-init,${MQTTASYNC_ENTRY_POINT}" + ) + endif() + + if(NOT PAHO_BUILD_SHARED) + install(TARGETS paho-mqtt3cs-static paho-mqtt3as-static + EXPORT eclipse-paho-mqtt-cTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + else() + install(TARGETS paho-mqtt3cs-static paho-mqtt3as-static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + endif() + + foreach(TARGET paho-mqtt3cs-static paho-mqtt3as-static) + target_include_directories(${TARGET} + PUBLIC + $ + $ + PRIVATE + ${CMAKE_BINARY_DIR} + ) + + target_link_libraries(${TARGET} + PUBLIC + OpenSSL::SSL OpenSSL::Crypto ${LIBS_SYSTEM} + ) + endforeach() + endif() +endif() + +install(EXPORT eclipse-paho-mqtt-cTargets + FILE eclipse-paho-mqtt-cConfig.cmake + NAMESPACE eclipse-paho-mqtt-c:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/eclipse-paho-mqtt-c +) + +include(CMakePackageConfigHelpers) + +write_basic_package_version_file("eclipse-paho-mqtt-cConfigVersion.cmake" + VERSION ${CLIENT_VERSION} + COMPATIBILITY SameMajorVersion +) + +install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/eclipse-paho-mqtt-c) + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/cmake/eclipse-paho-mqtt-c +) # Base64 test -ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) -TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" ) -IF (PAHO_WITH_SSL) - ADD_EXECUTABLE( Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h ) - TARGET_LINK_LIBRARIES( Base64TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) - TARGET_COMPILE_DEFINITIONS( Base64TestOpenSSL PUBLIC "-DBASE64_TEST -DOPENSSL=1" ) -ENDIF (PAHO_WITH_SSL) +add_executable(Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h) +target_compile_definitions(Base64Test PUBLIC BASE64_TEST) + +if(PAHO_WITH_SSL) + add_executable(Base64TestOpenSSL EXCLUDE_FROM_ALL Base64.c Base64.h ) + target_link_libraries(Base64TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) + target_compile_definitions(Base64TestOpenSSL PUBLIC BASE64_TEST OPENSSL=1) +endif() # SHA1 test -ADD_EXECUTABLE( Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h ) -TARGET_COMPILE_DEFINITIONS( Sha1Test PUBLIC "-DSHA1_TEST" ) -IF (PAHO_WITH_SSL) - ADD_EXECUTABLE( Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h ) - TARGET_LINK_LIBRARIES( Sha1TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) - TARGET_COMPILE_DEFINITIONS( Sha1TestOpenSSL PUBLIC "-DSHA1_TEST -DOPENSSL=1" ) -ENDIF (PAHO_WITH_SSL) +add_executable(Sha1Test EXCLUDE_FROM_ALL SHA1.c SHA1.h) +target_compile_definitions(Sha1Test PUBLIC SHA1_TEST) + +if(PAHO_WITH_SSL) + add_executable(Sha1TestOpenSSL EXCLUDE_FROM_ALL SHA1.c SHA1.h) + target_link_libraries(Sha1TestOpenSSL OpenSSL::SSL OpenSSL::Crypto) + target_compile_definitions(Sha1TestOpenSSL PUBLIC SHA1_TEST OPENSSL=1) +endif() diff --git a/src/VersionInfo.h.in b/src/VersionInfo.h.in index 5b91bf3a7..0f5bb8e3f 100644 --- a/src/VersionInfo.h.in +++ b/src/VersionInfo.h.in @@ -1,7 +1,17 @@ +/******************************************************************************* + * Version information for Eclipse Paho MQTT C. + *******************************************************************************/ + #ifndef VERSIONINFO_H #define VERSIONINFO_H #define BUILD_TIMESTAMP "@BUILD_TIMESTAMP@" -#define CLIENT_VERSION "@CLIENT_VERSION@" +#define CLIENT_VERSION "@PROJECT_VERSION@" + +#define PAHO_MQTT_C_VERSION "@PROJECT_VERSION@" +#define PAHO_MQTT_C_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define PAHO_MQTT_C_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define PAHO_MQTT_C_VERSION_PATCH @PROJECT_VERSION_PATCH@ + #endif /* VERSIONINFO_H */ diff --git a/src/samples/CMakeLists.txt b/src/samples/CMakeLists.txt index 95311237b..143834686 100644 --- a/src/samples/CMakeLists.txt +++ b/src/samples/CMakeLists.txt @@ -15,86 +15,97 @@ # Ian Craggs - update sample names #*******************************************************************************/ -# Note: on OS X you should install XCode and the associated command-line tools - ## compilation/linkage settings -INCLUDE_DIRECTORIES( - . - ${PROJECT_SOURCE_DIR}/src - ${PROJECT_BINARY_DIR} - ) +include_directories( + . + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_BINARY_DIR} +) -IF (WIN32) - ADD_DEFINITIONS(/DCMAKE_BUILD /D_CRT_SECURE_NO_DEPRECATE) -ENDIF() +if(WIN32) + add_definitions(/DCMAKE_BUILD /D_CRT_SECURE_NO_DEPRECATE) +endif() # sample files c -IF (PAHO_BUILD_SHARED) -ADD_EXECUTABLE(paho_c_pub paho_c_pub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_c_sub paho_c_sub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_cs_pub paho_cs_pub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_cs_sub paho_cs_sub.c pubsub_opts.c) - -SET_TARGET_PROPERTIES( - paho_c_pub paho_c_sub paho_cs_pub paho_cs_sub PROPERTIES - COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1") - -TARGET_LINK_LIBRARIES(paho_c_pub paho-mqtt3as) -TARGET_LINK_LIBRARIES(paho_c_sub paho-mqtt3as) -TARGET_LINK_LIBRARIES(paho_cs_pub paho-mqtt3cs) -TARGET_LINK_LIBRARIES(paho_cs_sub paho-mqtt3cs) - -ADD_EXECUTABLE(MQTTAsync_subscribe MQTTAsync_subscribe.c) -ADD_EXECUTABLE(MQTTAsync_publish MQTTAsync_publish.c) -ADD_EXECUTABLE(MQTTAsync_publish_time MQTTAsync_publish_time.c) -ADD_EXECUTABLE(MQTTClient_subscribe MQTTClient_subscribe.c) -ADD_EXECUTABLE(MQTTClient_publish MQTTClient_publish.c) -ADD_EXECUTABLE(MQTTClient_publish_async MQTTClient_publish_async.c) - -SET_TARGET_PROPERTIES( - MQTTAsync_subscribe MQTTAsync_publish MQTTAsync_publish_time MQTTClient_subscribe MQTTClient_publish MQTTClient_publish_async PROPERTIES - COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1") - -TARGET_LINK_LIBRARIES(MQTTAsync_subscribe paho-mqtt3a) -TARGET_LINK_LIBRARIES(MQTTAsync_publish paho-mqtt3a) -TARGET_LINK_LIBRARIES(MQTTAsync_publish_time paho-mqtt3a) -TARGET_LINK_LIBRARIES(MQTTClient_subscribe paho-mqtt3c) -TARGET_LINK_LIBRARIES(MQTTClient_publish paho-mqtt3c) -TARGET_LINK_LIBRARIES(MQTTClient_publish_async paho-mqtt3c) - -INSTALL(TARGETS paho_c_sub - paho_c_pub - paho_cs_sub - paho_cs_pub - MQTTAsync_subscribe - MQTTAsync_publish - MQTTAsync_publish_time - MQTTClient_subscribe - MQTTClient_publish - MQTTClient_publish_async +if(PAHO_BUILD_SHARED) + if(PAHO_WITH_SSL) + foreach(TARGET paho_c_pub paho_c_sub paho_cs_pub paho_cs_sub) + add_executable(${TARGET} ${TARGET}.c pubsub_opts.c) + set_target_properties(${TARGET} PROPERTIES + COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1" + ) + endforeach() + + target_link_libraries(paho_c_pub paho-mqtt3as) + target_link_libraries(paho_c_sub paho-mqtt3as) + + target_link_libraries(paho_cs_pub paho-mqtt3cs) + target_link_libraries(paho_cs_sub paho-mqtt3cs) + + install( + TARGETS + paho_c_sub + paho_c_pub + paho_cs_sub + paho_cs_pub + + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + + endif() + + foreach(TARGET MQTTAsync_subscribe MQTTAsync_publish MQTTAsync_publish_time + MQTTClient_subscribe MQTTClient_publish MQTTClient_publish_async) + add_executable(${TARGET} ${TARGET}.c) + set_target_properties(${TARGET} PROPERTIES + COMPILE_DEFINITIONS "PAHO_MQTT_IMPORTS=1" + ) + endforeach() + + target_link_libraries(MQTTAsync_subscribe paho-mqtt3a) + target_link_libraries(MQTTAsync_publish paho-mqtt3a) + target_link_libraries(MQTTAsync_publish_time paho-mqtt3a) + + target_link_libraries(MQTTClient_subscribe paho-mqtt3c) + target_link_libraries(MQTTClient_publish paho-mqtt3c) + target_link_libraries(MQTTClient_publish_async paho-mqtt3c) + + install( + TARGETS + MQTTAsync_subscribe + MQTTAsync_publish + MQTTAsync_publish_time + MQTTClient_subscribe + MQTTClient_publish + MQTTClient_publish_async RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -ENDIF() + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() + +if(PAHO_BUILD_STATIC AND PAHO_WITH_SSL) + foreach(TARGET paho_c_pub paho_c_sub paho_cs_pub paho_cs_sub) + add_executable(${TARGET}_static ${TARGET}.c pubsub_opts.c) + endforeach() -IF (PAHO_BUILD_STATIC) -ADD_EXECUTABLE(paho_c_pub_static paho_c_pub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_c_sub_static paho_c_sub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_cs_pub_static paho_cs_pub.c pubsub_opts.c) -ADD_EXECUTABLE(paho_cs_sub_static paho_cs_sub.c pubsub_opts.c) + target_link_libraries(paho_c_pub_static paho-mqtt3as-static) + target_link_libraries(paho_c_sub_static paho-mqtt3as-static) -TARGET_LINK_LIBRARIES(paho_c_pub_static paho-mqtt3as-static) -TARGET_LINK_LIBRARIES(paho_c_sub_static paho-mqtt3as-static) -TARGET_LINK_LIBRARIES(paho_cs_pub_static paho-mqtt3cs-static) -TARGET_LINK_LIBRARIES(paho_cs_sub_static paho-mqtt3cs-static) + target_link_libraries(paho_cs_pub_static paho-mqtt3cs-static) + target_link_libraries(paho_cs_sub_static paho-mqtt3cs-static) -INSTALL(TARGETS paho_c_sub_static - paho_c_pub_static - paho_cs_sub_static - paho_cs_pub_static + install( + TARGETS + paho_c_sub_static + paho_c_pub_static + paho_cs_sub_static + paho_cs_pub_static RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -ENDIF() + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b380e8f18..0e6b94929 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,87 +1,80 @@ -PROJECT(mqtt-tests C) - -SET(MQTT_TEST_BROKER "tcp://localhost:1883" CACHE STRING "Hostname of a test MQTT broker to use") -SET(MQTT_WS_TEST_BROKER "ws://localhost:1883" CACHE STRING "WebSocket connection to a test MQTT broker") -SET(MQTT_TEST_PROXY "tcp://localhost:1884" CACHE STRING "Hostname of the test proxy to use") -SET(MQTT_WS_TEST_PROXY "tcp://localhost:1884" CACHE STRING "WebSocket connection of a test proxy to use") -SET(MQTT_SSL_HOSTNAME "localhost" CACHE STRING "Hostname of a test SSL MQTT broker to use") - -SET(CERTDIR ${CMAKE_SOURCE_DIR}/test/ssl) - - -IF (WIN32) - SET(LIBS_SYSTEM ws2_32) -ELSEIF (UNIX) - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(LIBS_SYSTEM c dl pthread) - ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - SET(LIBS_SYSTEM compat pthread) - ELSE() - SET(LIBS_SYSTEM c pthread) - ENDIF() -ENDIF() - -ADD_EXECUTABLE( +project(mqtt-tests C) + +set(MQTT_TEST_BROKER "tcp://localhost:1883" CACHE STRING "Hostname of a test MQTT broker to use") +set(MQTT_WS_TEST_BROKER "ws://localhost:1883" CACHE STRING "WebSocket connection to a test MQTT broker") +set(MQTT_TEST_PROXY "tcp://localhost:1884" CACHE STRING "Hostname of the test proxy to use") +set(MQTT_WS_TEST_PROXY "tcp://localhost:1884" CACHE STRING "WebSocket connection of a test proxy to use") +set(MQTT_SSL_HOSTNAME "localhost" CACHE STRING "Hostname of a test SSL MQTT broker to use") + +set(CERTDIR ${CMAKE_SOURCE_DIR}/test/ssl) + +if(WIN32) + set(LIBS_SYSTEM ws2_32) +elseif(UNIX) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(LIBS_SYSTEM c dl pthread) + elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(LIBS_SYSTEM compat pthread) + else() + set(LIBS_SYSTEM c pthread) + endif() +endif() + +add_executable( thread thread.c ../src/Thread.c ) -SET_TARGET_PROPERTIES( +set_target_properties( thread PROPERTIES COMPILE_DEFINITIONS "NOSTACKTRACE;NOLOG_MESSAGES" ) -TARGET_LINK_LIBRARIES( +target_link_libraries( thread ${LIBS_SYSTEM} ) -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test1-static - test1.c - ) - TARGET_LINK_LIBRARIES( - test1-static - paho-mqtt3c-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test1-static test1.c) + target_link_libraries(test1-static paho-mqtt3c-static) - ADD_TEST( + add_test( NAME test1-1-single-thread-client-static COMMAND "test1-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-2-multithread-callbacks-static COMMAND "test1-static" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-3-connack-return-codes-static COMMAND "test1-static" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-4-client-persistence-static COMMAND "test1-static" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-5-disconnect-with-quiesce-static COMMAND "test1-static" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-6-connlost-will-message-static COMMAND "test1-static" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test1-7-connlost-binary-will-message-static COMMAND "test1-static" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test1-1-single-thread-client-static test1-2-multithread-callbacks-static test1-3-connack-return-codes-static @@ -91,62 +84,56 @@ IF (PAHO_BUILD_STATIC) test1-7-connlost-binary-will-message-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test1 - test1.c - ) - TARGET_LINK_LIBRARIES( - test1 - paho-mqtt3c - ) - - IF (WIN32) - ADD_CUSTOM_COMMAND( - TARGET test1 PRE_BUILD - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/dll-copy.cmake - COMMENT "Copying DLLs to test directory" - ) - ENDIF() +if(PAHO_BUILD_SHARED) + add_executable(test1 test1.c) + target_link_libraries(test1 paho-mqtt3c) + + if(WIN32) + add_custom_command( + TARGET test1 PRE_BUILD + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/dll-copy.cmake + COMMENT "Copying DLLs to test directory" + ) + endif() - ADD_TEST( + add_test( NAME test1-1-single-thread-client COMMAND "test1" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - - ADD_TEST( + + add_test( NAME test1-2-multithread-callbacks COMMAND "test1" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - - ADD_TEST( + + add_test( NAME test1-3-connack-return-codes COMMAND "test1" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-4-client-persistence COMMAND "test1" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-5-disconnect-with-quiesce COMMAND "test1" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test1-6-connlost-will-message COMMAND "test1" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test1-7-connlost-binary-will-message COMMAND "test1" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test1-1-single-thread-client test1-2-multithread-callbacks test1-3-connack-return-codes @@ -157,101 +144,94 @@ IF (PAHO_BUILD_SHARED) PROPERTIES TIMEOUT 540 ) - ADD_TEST( - NAME test1-1-ws-single-thread-client - COMMAND "test1" "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} - ) - - ADD_TEST( - NAME test1-2-ws-multithread-callbacks - COMMAND "test1" "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} - ) + add_test( + NAME test1-1-ws-single-thread-client + COMMAND "test1" "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} + ) - ADD_TEST( - NAME test1-3-ws-connack-return-codes - COMMAND "test1" "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} - ) - - ADD_TEST( - NAME test1-4-ws-client-persistence - COMMAND "test1" "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} - ) + add_test( + NAME test1-2-ws-multithread-callbacks + COMMAND "test1" "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} + ) - ADD_TEST( - NAME test1-5-ws-disconnect-with-quiesce - COMMAND "test1" "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} - ) - - ADD_TEST( - NAME test1-6-ws-connlost-will-message - COMMAND "test1" "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) - - ADD_TEST( - NAME test1-7-ws-connlost-binary-will-message - COMMAND "test1" "--test_no" "7" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test1-3-ws-connack-return-codes + COMMAND "test1" "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} + ) + + add_test( + NAME test1-4-ws-client-persistence + COMMAND "test1" "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} + ) + + add_test( + NAME test1-5-ws-disconnect-with-quiesce + COMMAND "test1" "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} + ) + + add_test( + NAME test1-6-ws-connlost-will-message + COMMAND "test1" "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) + + add_test( + NAME test1-7-ws-connlost-binary-will-message + COMMAND "test1" "--test_no" "7" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - SET_TESTS_PROPERTIES( - test1-1-ws-single-thread-client - test1-2-ws-multithread-callbacks - test1-3-ws-connack-return-codes - test1-4-ws-client-persistence - test1-5-ws-disconnect-with-quiesce - test1-6-ws-connlost-will-message - test1-7-ws-connlost-binary-will-message - PROPERTIES TIMEOUT 540 - ) -ENDIF() + set_tests_properties( + test1-1-ws-single-thread-client + test1-2-ws-multithread-callbacks + test1-3-ws-connack-return-codes + test1-4-ws-client-persistence + test1-5-ws-disconnect-with-quiesce + test1-6-ws-connlost-will-message + test1-7-ws-connlost-binary-will-message + PROPERTIES TIMEOUT 540 + ) +endif() +if(PAHO_BUILD_STATIC) + add_executable(test15-static test15.c) + target_link_libraries(test15-static paho-mqtt3c-static) -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test15-static - test15.c - ) - TARGET_LINK_LIBRARIES( - test15-static - paho-mqtt3c-static - ) - - ADD_TEST( + add_test( NAME test15-1-single-thread-client-static COMMAND "test15-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-2-multithread-callbacks-static COMMAND "test15-static" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-3-connack-return-codes-static COMMAND "test15-static" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-4-client-persistence-static COMMAND "test15-static" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-5-disconnect-with-quiesce-static COMMAND "test15-static" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-6-connlost-will-message-static COMMAND "test15-static" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-7-connlost-binary-will-message-static COMMAND "test15-static" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test15-1-single-thread-client-static test15-2-multithread-callbacks-static test15-3-connack-return-codes-static @@ -261,54 +241,48 @@ IF (PAHO_BUILD_STATIC) test15-7-connlost-binary-will-message-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test15 - test15.c - ) - TARGET_LINK_LIBRARIES( - test15 - paho-mqtt3c - ) +if(PAHO_BUILD_SHARED) + add_executable(test15 test15.c) + target_link_libraries(test15 paho-mqtt3c) - ADD_TEST( + add_test( NAME test15-1-single-thread-client COMMAND "test15" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-2-multithread-callbacks COMMAND "test15" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-3-connack-return-codes COMMAND "test15" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-4-client-persistence COMMAND "test15" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-5-disconnect-with-quiesce COMMAND "test15" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-6-connlost-will-message COMMAND "test15" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test15-7-connlost-binary-will-message COMMAND "test15" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test15-1-single-thread-client test15-2-multithread-callbacks test15-3-connack-return-codes @@ -318,183 +292,163 @@ IF (PAHO_BUILD_SHARED) test15-7-connlost-binary-will-message PROPERTIES TIMEOUT 540 ) - - ADD_TEST( - NAME test15-1-ws-single-thread-client - COMMAND "test15" "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) - - ADD_TEST( - NAME test15-2-ws-multithread-callbacks - COMMAND "test15" "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + + add_test( + NAME test15-1-ws-single-thread-client + COMMAND "test15" "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test15-3-ws-connack-return-codes - COMMAND "test15" "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test15-2-ws-multithread-callbacks + COMMAND "test15" "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) + + add_test( + NAME test15-3-ws-connack-return-codes + COMMAND "test15" "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test15-4-ws-client-persistence - COMMAND "test15" "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test15-4-ws-client-persistence + COMMAND "test15" "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test15-5-ws-disconnect-with-quiesce - COMMAND "test15" "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test15-5-ws-disconnect-with-quiesce + COMMAND "test15" "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test15-6-ws-connlost-will-message - COMMAND "test15" "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test15-6-ws-connlost-will-message + COMMAND "test15" "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test15-7-ws-connlost-binary-will-message - COMMAND "test15" "--test_no" "7" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test15-7-ws-connlost-binary-will-message + COMMAND "test15" "--test_no" "7" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - SET_TESTS_PROPERTIES( - test15-1-ws-single-thread-client - test15-2-ws-multithread-callbacks - test15-3-ws-connack-return-codes - test15-4-ws-client-persistence - test15-5-ws-disconnect-with-quiesce - test15-6-ws-connlost-will-message - test15-7-ws-connlost-binary-will-message - PROPERTIES TIMEOUT 540 - ) -ENDIF() + set_tests_properties( + test15-1-ws-single-thread-client + test15-2-ws-multithread-callbacks + test15-3-ws-connack-return-codes + test15-4-ws-client-persistence + test15-5-ws-disconnect-with-quiesce + test15-6-ws-connlost-will-message + test15-7-ws-connlost-binary-will-message + PROPERTIES TIMEOUT 540 + ) +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test2-static - test2.c - ) - - TARGET_LINK_LIBRARIES( - test2-static - paho-mqtt3c-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test2-static test2.c) + target_link_libraries(test2-static paho-mqtt3c-static) - ADD_TEST( + add_test( NAME test2-1-multiple-threads-single-client-static COMMAND test2-static "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test2-1-multiple-threads-single-client-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test2 - test2.c - ) - - TARGET_LINK_LIBRARIES( - test2 - paho-mqtt3c - ) - - ADD_TEST( - NAME test2-1-multiple-threads-single-client - COMMAND test2 "--connection" ${MQTT_TEST_BROKER} - ) +if(PAHO_BUILD_SHARED) + add_executable(test2 test2.c) + target_link_libraries(test2 paho-mqtt3c) + + add_test( + NAME test2-1-multiple-threads-single-client + COMMAND test2 "--connection" ${MQTT_TEST_BROKER} + ) - ADD_TEST( - NAME test2-1-ws-multiple-threads-single-client - COMMAND test2 "--connection" ${MQTT_WS_TEST_BROKER} + add_test( + NAME test2-1-ws-multiple-threads-single-client + COMMAND test2 "--connection" ${MQTT_WS_TEST_BROKER} ) - - SET_TESTS_PROPERTIES( - test2-1-multiple-threads-single-client - test2-1-ws-multiple-threads-single-client - PROPERTIES TIMEOUT 540 + + set_tests_properties( + test2-1-multiple-threads-single-client + test2-1-ws-multiple-threads-single-client + PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_WITH_SSL) +if(PAHO_WITH_SSL) - IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test3-static - test3.c - ) - TARGET_LINK_LIBRARIES( - test3-static - paho-mqtt3cs-static - ) + if(PAHO_BUILD_STATIC) + add_executable(test3-static test3.c) + target_link_libraries(test3-static paho-mqtt3cs-static) - ADD_TEST( + add_test( NAME test3-1-ssl-conn-to-non-SSL-broker-static COMMAND test3-static "--test_no" "1" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2as-mutual-ssl-auth-single-thread-static COMMAND test3-static "--test_no" "2" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2am-mutual-ssl-auth-multi-thread-static COMMAND test3-static "--test_no" "3" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2b-mutual-ssl-broker-missing-client-cert-static COMMAND test3-static "--test_no" "4" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2c-mutual-ssl-client-missing-broker-cert-static COMMAND test3-static "--test_no" "5" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( - NAME test3-2e-ssl-with-ha-static - COMMAND test3-static "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2e-ssl-with-ha-static + COMMAND test3-static "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-2e-ws-ssl-with-ha-static - COMMAND test3-static "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2e-ws-ssl-with-ha-static + COMMAND test3-static "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( + add_test( NAME test3-3as-broker-auth-server-cert-in-client-store-single-thread-static COMMAND test3-static "--test_no" "6" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-3am-broker-auth-server-cert-in-client-store-multi-thread-static COMMAND test3-static "--test_no" "7" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-3b-broker-auth-client-missing-broker-cert-static COMMAND test3-static "--test_no" "8" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-4s-broker-auth-accept-invalid-certificate-single-thread-static COMMAND test3-static "--test_no" "9" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-4m-broker-auth-accept-invalid-certificate-multi-thread-static COMMAND test3-static "--test_no" "10" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - #ADD_TEST( + #add_test( # NAME test3-6-psk-ssl-auth-static # COMMAND test3-static "--test_no" "11" "--hostname" ${MQTT_SSL_HOSTNAME} #) - SET_TESTS_PROPERTIES( + set_tests_properties( test3-1-ssl-conn-to-non-SSL-broker-static test3-2as-mutual-ssl-auth-single-thread-static test3-2am-mutual-ssl-auth-multi-thread-static @@ -510,80 +464,74 @@ IF (PAHO_WITH_SSL) # test3-6-psk-ssl-auth-static PROPERTIES TIMEOUT 540 ) - ENDIF() + endif() - IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test3 - test3.c - ) - TARGET_LINK_LIBRARIES( - test3 - paho-mqtt3cs - ) + if(PAHO_BUILD_SHARED) + add_executable(test3 test3.c) + target_link_libraries(test3 paho-mqtt3cs) - ADD_TEST( + add_test( NAME test3-1-ssl-conn-to-non-SSL-broker COMMAND test3 "--test_no" "1" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2as-mutual-ssl-auth-single-thread COMMAND test3 "--test_no" "2" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2am-mutual-ssl-auth-multi-thread COMMAND test3 "--test_no" "3" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2b-mutual-ssl-broker-missing-client-cert COMMAND test3 "--test_no" "4" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-2c-mutual-ssl-client-missing-broker-cert COMMAND test3 "--test_no" "5" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( - NAME test3-2e-ssl-with-ha - COMMAND test3 "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2e-ssl-with-ha + COMMAND test3 "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-3as-broker-auth-server-cert-in-client-store-single-thread - COMMAND test3 "--test_no" "6" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-3as-broker-auth-server-cert-in-client-store-single-thread + COMMAND test3 "--test_no" "6" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-3am-broker-auth-server-cert-in-client-store-multi-thread + add_test( + NAME test3-3am-broker-auth-server-cert-in-client-store-multi-thread COMMAND test3 "--test_no" "7" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-3b-broker-auth-client-missing-broker-cert COMMAND test3 "--test_no" "8" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-4s-broker-auth-accept-invalid-certificate-single-thread COMMAND test3 "--test_no" "9" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test3-4m-broker-auth-accept-invalid-certificate-multi-thread COMMAND test3 "--test_no" "10" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - #ADD_TEST( + #add_test( # NAME test3-6-psk-ssl-auth # COMMAND test3 "--test_no" "11" "--hostname" ${MQTT_SSL_HOSTNAME} #) - SET_TESTS_PROPERTIES( - test3-1-ssl-conn-to-non-SSL-broker + set_tests_properties( + test3-1-ssl-conn-to-non-SSL-broker test3-2as-mutual-ssl-auth-single-thread test3-2am-mutual-ssl-auth-multi-thread test3-2b-mutual-ssl-broker-missing-client-cert @@ -598,137 +546,129 @@ IF (PAHO_WITH_SSL) PROPERTIES TIMEOUT 540 ) - ADD_TEST( - NAME test3-1-ws-ssl-conn-to-non-SSL-broker - COMMAND test3 "--test_no" "1" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) - - ADD_TEST( - NAME test3-2as-ws-mutual-ssl-auth-single-thread - COMMAND test3 "--test_no" "2" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-1-ws-ssl-conn-to-non-SSL-broker + COMMAND test3 "--test_no" "1" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) + + add_test( + NAME test3-2as-ws-mutual-ssl-auth-single-thread + COMMAND test3 "--test_no" "2" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-2am-ws-mutual-ssl-auth-multi-thread - COMMAND test3 "--test_no" "3" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2am-ws-mutual-ssl-auth-multi-thread + COMMAND test3 "--test_no" "3" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-2b-ws-mutual-ssl-broker-missing-client-cert - COMMAND test3 "--test_no" "4" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2b-ws-mutual-ssl-broker-missing-client-cert + COMMAND test3 "--test_no" "4" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-2c-ws-mutual-ssl-client-missing-broker-cert - COMMAND test3 "--test_no" "5" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2c-ws-mutual-ssl-client-missing-broker-cert + COMMAND test3 "--test_no" "5" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-2e-ws-ssl-with-ha - COMMAND test3 "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-2e-ws-ssl-with-ha + COMMAND test3 "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread - COMMAND test3 "--test_no" "6" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread + COMMAND test3 "--test_no" "6" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread - COMMAND test3 "--test_no" "7" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread + COMMAND test3 "--test_no" "7" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-3b-ws-broker-auth-client-missing-broker-cert - COMMAND test3 "--test_no" "8" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-3b-ws-broker-auth-client-missing-broker-cert + COMMAND test3 "--test_no" "8" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread - COMMAND test3 "--test_no" "9" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread + COMMAND test3 "--test_no" "9" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread - COMMAND test3 "--test_no" "10" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread + COMMAND test3 "--test_no" "10" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - #ADD_TEST( - # NAME test3-6-ws-psk-ssl-auth - # COMMAND test3 "--test_no" "11" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} - #) + #add_test( + # NAME test3-6-ws-psk-ssl-auth + # COMMAND test3 "--test_no" "11" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} + #) - SET_TESTS_PROPERTIES( - test3-1-ws-ssl-conn-to-non-SSL-broker - test3-2as-ws-mutual-ssl-auth-single-thread - test3-2am-ws-mutual-ssl-auth-multi-thread - test3-2b-ws-mutual-ssl-broker-missing-client-cert - test3-2c-ws-mutual-ssl-client-missing-broker-cert - test3-2e-ws-ssl-with-ha - test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread - test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread - test3-3b-ws-broker-auth-client-missing-broker-cert - test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread - test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread - # test3-6-psk-ssl-auth - PROPERTIES TIMEOUT 540 - ) - ENDIF() - -ENDIF() - -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test4-static - test4.c - ) - - TARGET_LINK_LIBRARIES( - test4-static - paho-mqtt3a-static - ) - - ADD_TEST( + set_tests_properties( + test3-1-ws-ssl-conn-to-non-SSL-broker + test3-2as-ws-mutual-ssl-auth-single-thread + test3-2am-ws-mutual-ssl-auth-multi-thread + test3-2b-ws-mutual-ssl-broker-missing-client-cert + test3-2c-ws-mutual-ssl-client-missing-broker-cert + test3-2e-ws-ssl-with-ha + test3-3as-ws-broker-auth-server-cert-in-client-store-single-thread + test3-3am-ws-broker-auth-server-cert-in-client-store-multi-thread + test3-3b-ws-broker-auth-client-missing-broker-cert + test3-4s-ws-broker-auth-accept-invalid-certificate-single-thread + test3-4m-ws-broker-auth-accept-invalid-certificate-multi-thread + # test3-6-psk-ssl-auth + PROPERTIES TIMEOUT 540 + ) + endif() +endif() + +if(PAHO_BUILD_STATIC) + add_executable(test4-static test4.c) + target_link_libraries(test4-static paho-mqtt3a-static) + + add_test( NAME test4-1-basic-connect-subscribe-receive-static COMMAND test4-static "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-2-connect-timeout-static COMMAND test4-static "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-3-multiple-client-objs-simultaneous-working-static COMMAND test4-static "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-4-send-receive-big-messages-static COMMAND test4-static "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-5-connack-return-codes-static COMMAND test4-static "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-6-ha-connections-static COMMAND test4-static "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-7-pending-tokens-static COMMAND test4-static "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-8-incomplete-commands-requests-static COMMAND test4-static "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test4-1-basic-connect-subscribe-receive-static test4-2-connect-timeout-static test4-3-multiple-client-objs-simultaneous-working-static @@ -739,59 +679,53 @@ IF (PAHO_BUILD_STATIC) test4-8-incomplete-commands-requests-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test4 - test4.c - ) - TARGET_LINK_LIBRARIES( - test4 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test4 test4.c) + target_link_libraries(test4 paho-mqtt3a) - ADD_TEST( + add_test( NAME test4-1-basic-connect-subscribe-receive COMMAND test4 "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-2-connect-timeout COMMAND test4 "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-3-multiple-client-objs-simultaneous-working COMMAND test4 "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-4-send-receive-big-messages COMMAND test4 "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-5-connack-return-codes COMMAND test4 "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-6-ha-connections COMMAND test4 "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-7-pending-tokens COMMAND test4 "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test4-8-incomplete-commands-requests COMMAND test4 "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test4-1-basic-connect-subscribe-receive test4-2-connect-timeout test4-3-multiple-client-objs-simultaneous-working @@ -802,60 +736,53 @@ IF (PAHO_BUILD_SHARED) test4-8-incomplete-commands-requests PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test45-static - test45.c - ) +if(PAHO_BUILD_STATIC) + add_executable(test45-static test45.c) + target_link_libraries(test45-static paho-mqtt3a-static) - TARGET_LINK_LIBRARIES( - test45-static - paho-mqtt3a-static - ) - - ADD_TEST( + add_test( NAME test45-1-basic-connect-subscribe-receive-static COMMAND test45-static "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-2-connect-timeout-static COMMAND test45-static "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-3-multiple-client-objs-simultaneous-working-static COMMAND test45-static "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-4-send-receive-big-messages-static COMMAND test45-static "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-5-connack-return-codes-static COMMAND test45-static "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-6-ha-connections-static COMMAND test45-static "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-7-pending-tokens-static COMMAND test45-static "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-8-incomplete-commands-requests-static COMMAND test45-static "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test45-1-basic-connect-subscribe-receive-static test45-2-connect-timeout-static test45-3-multiple-client-objs-simultaneous-working-static @@ -866,59 +793,53 @@ IF (PAHO_BUILD_STATIC) test45-8-incomplete-commands-requests-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test45 - test45.c - ) - TARGET_LINK_LIBRARIES( - test45 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test45 test45.c) + target_link_libraries(test45 paho-mqtt3a) - ADD_TEST( + add_test( NAME test45-1-basic-connect-subscribe-receive COMMAND test45 "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-2-connect-timeout COMMAND test45 "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-3-multiple-client-objs-simultaneous-working COMMAND test45 "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-4-send-receive-big-messages COMMAND test45 "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-5-connack-return-codes COMMAND test45 "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-6-ha-connections COMMAND test45 "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-7-pending-tokens COMMAND test45 "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test45-8-incomplete-commands-requests COMMAND test45 "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test45-1-basic-connect-subscribe-receive test45-2-connect-timeout test45-3-multiple-client-objs-simultaneous-working @@ -929,168 +850,160 @@ IF (PAHO_BUILD_SHARED) test45-8-incomplete-commands-requests PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_WITH_SSL) - IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test5-static - test5.c - ) +if(PAHO_WITH_SSL) + if(PAHO_BUILD_STATIC) + add_executable(test5-static test5.c) + target_link_libraries(test5-static paho-mqtt3as-static) - TARGET_LINK_LIBRARIES( - test5-static - paho-mqtt3as-static - ) - - ADD_TEST( + add_test( NAME test5-1-ssl-connection-to-no-SSL-server-static COMMAND test5-static "--test_no" "1" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-1-ws-ssl-connection-to-no-SSL-server-static COMMAND test5-static "--test_no" "1" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2a-mutual-ssl-auth-certificates-in-place-static COMMAND test5-static "--test_no" "2" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2a-ws-mutual-ssl-auth-certificates-in-place-static COMMAND test5-static "--test_no" "2" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2b-mutual-ssl-auth-broker-missing-client-cert-static COMMAND test5-static "--test_no" "3" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2b-ws-mutual-ssl-auth-broker-missing-client-cert-static COMMAND test5-static "--test_no" "3" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2c-mutual-ssl-auth-client-missing-broker-cert-static COMMAND test5-static "--test_no" "4" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2c-ws-mutual-ssl-auth-client-missing-broker-cert-static COMMAND test5-static "--test_no" "4" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2d-mutual-ssl-auth-client-missing-client-cert-static COMMAND test5-static "--test_no" "5" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2d-ws-mutual-ssl-auth-client-missing-client-cert-static COMMAND test5-static "--test_no" "5" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3a-server-auth-server-cert-in-client-store-static COMMAND test5-static "--test_no" "6" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3a-ws-server-auth-server-cert-in-client-store-static COMMAND test5-static "--test_no" "6" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3b-server-auth-client-missing-broker-cert-static COMMAND test5-static "--test_no" "7" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3b-ws-server-auth-client-missing-broker-cert-static COMMAND test5-static "--test_no" "7" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-4-accept-invalid-certificates-static COMMAND test5-static "--test_no" "8" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-4-ws-accept-invalid-certificates-static COMMAND test5-static "--test_no" "8" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-6-multiple-connections-static COMMAND test5-static "--test_no" "9" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-6-ws-multiple-connections-static COMMAND test5-static "--test_no" "9" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-7-big-messages-static COMMAND test5-static "--test_no" "10" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-7-ws-big-messages-static COMMAND test5-static "--test_no" "10" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( - NAME test5-2e-ssl-with-ha-static - COMMAND test5-static "--test_no" "14" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test5-2e-ssl-with-ha-static + COMMAND test5-static "--test_no" "14" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test5-2e-ws-ssl-with-ha-static - COMMAND test5-static "--test_no" "14" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test5-2e-ws-ssl-with-ha-static + COMMAND test5-static "--test_no" "14" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - #ADD_TEST( + #add_test( # NAME test5-8-psk-ssl-auth-static # COMMAND test5-static "--test_no" "11" "--hostname" ${MQTT_SSL_HOSTNAME} #) - IF (NOT WIN32) + if(NOT WIN32) # OpenSSL CApath tests rely on Unix-type filesystem - can it work on Windows? - ADD_TEST( + add_test( NAME test5-5-server-verify-with-capath-static COMMAND test5-static "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/capath" ) - ADD_TEST( + add_test( NAME test5-5-ws-server-verify-with-capath-static COMMAND test5-static "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/capath" ) - ADD_TEST( + add_test( NAME test5-6-server-verify-with-capath-static COMMAND test5-static "--test_no" "13" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/notexist" ) - ADD_TEST( + add_test( NAME test5-6-ws-server-verify-with-capath-static COMMAND test5-static "--test_no" "13" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/notexist" ) - SET_TESTS_PROPERTIES( + set_tests_properties( test5-5-server-verify-with-capath-static test5-5-ws-server-verify-with-capath-static test5-6-server-verify-with-capath-static test5-6-ws-server-verify-with-capath-static PROPERTIES TIMEOUT 540 ) - ENDIF () - - - SET_TESTS_PROPERTIES( + endif() + + set_tests_properties( test5-1-ssl-connection-to-no-SSL-server-static test5-1-ws-ssl-connection-to-no-SSL-server-static test5-2a-mutual-ssl-auth-certificates-in-place-static @@ -1116,166 +1029,159 @@ IF (PAHO_WITH_SSL) # test5-8-psk-ssl-auth-static PROPERTIES TIMEOUT 540 ) - ENDIF() + endif() - IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test5 - test5.c - ) - - TARGET_LINK_LIBRARIES( - test5 - paho-mqtt3as - ) + if(PAHO_BUILD_SHARED) + add_executable(test5 test5.c) + target_link_libraries(test5 paho-mqtt3as) - ADD_TEST( + add_test( NAME test5-1-ssl-connection-to-no-SSL-server COMMAND test5 "--test_no" "1" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-1-ws-ssl-connection-to-no-SSL-server COMMAND test5 "--test_no" "1" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2a-mutual-ssl-auth-certificates-in-place COMMAND test5 "--test_no" "2" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2a-ws-mutual-ssl-auth-certificates-in-place COMMAND test5 "--test_no" "2" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2b-mutual-ssl-auth-broker-missing-client-cert COMMAND test5 "--test_no" "3" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2b-ws-mutual-ssl-auth-broker-missing-client-cert COMMAND test5 "--test_no" "3" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2c-mutual-ssl-auth-client-missing-broker-cert COMMAND test5 "--test_no" "4" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2c-ws-mutual-ssl-auth-client-missing-broker-cert COMMAND test5 "--test_no" "4" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2d-mutual-ssl-auth-client-missing-client-cert COMMAND test5 "--test_no" "5" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-2d-ws-mutual-ssl-auth-client-missing-client-cert COMMAND test5 "--test_no" "5" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3a-server-auth-server-cert-in-client-store COMMAND test5 "--test_no" "6" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3a-ws-server-auth-server-cert-in-client-store COMMAND test5 "--test_no" "6" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3b-server-auth-client-missing-broker-cert COMMAND test5 "--test_no" "7" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-3b-ws-server-auth-client-missing-broker-cert COMMAND test5 "--test_no" "7" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-4-accept-invalid-certificates COMMAND test5 "--test_no" "8" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-4-ws-accept-invalid-certificates COMMAND test5 "--test_no" "8" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-6-multiple-connections COMMAND test5 "--test_no" "9" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-6-ws-multiple-connections COMMAND test5 "--test_no" "9" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-7-big-messages COMMAND test5 "--test_no" "10" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( + add_test( NAME test5-7-ws-big-messages COMMAND test5 "--test_no" "10" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" ) - ADD_TEST( - NAME test5-2e-ssl-with-ha - COMMAND test5 "--test_no" "14" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) + add_test( + NAME test5-2e-ssl-with-ha + COMMAND test5 "--test_no" "14" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) - ADD_TEST( - NAME test5-2e-ws-ssl-with-ha - COMMAND test5 "--test_no" "14" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" - ) - - #ADD_TEST( + add_test( + NAME test5-2e-ws-ssl-with-ha + COMMAND test5 "--test_no" "14" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--server_key" "${CERTDIR}/test-root-ca.crt" + ) + + #add_test( # NAME test5-8-psk-ssl-auth # COMMAND test5 "--test_no" "11" "--hostname" ${MQTT_SSL_HOSTNAME} #) - - IF (NOT WIN32) + + if(NOT WIN32) # OpenSSL CApath tests rely on Unix-type filesystem - can it work on Windows? - ADD_TEST( + add_test( NAME test5-5-server-verify-with-capath COMMAND test5 "--test_no" "12" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/capath" ) - ADD_TEST( + add_test( NAME test5-5-ws-server-verify-with-capath COMMAND test5 "--test_no" "12" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/capath" ) - ADD_TEST( + add_test( NAME test5-6-server-verify-with-capath COMMAND test5 "--test_no" "13" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/notexist" ) - ADD_TEST( + add_test( NAME test5-6-ws-server-verify-with-capath COMMAND test5 "--test_no" "13" "--ws" "--hostname" ${MQTT_SSL_HOSTNAME} "--client_key" "${CERTDIR}/client.pem" "--capath" "${CERTDIR}/notexist" ) - SET_TESTS_PROPERTIES( + set_tests_properties( test5-5-server-verify-with-capath test5-5-ws-server-verify-with-capath test5-6-server-verify-with-capath test5-6-ws-server-verify-with-capath PROPERTIES TIMEOUT 540 ) - ENDIF () + ENDif() - SET_TESTS_PROPERTIES( + set_tests_properties( test5-1-ssl-connection-to-no-SSL-server test5-1-ws-ssl-connection-to-no-SSL-server test5-2a-mutual-ssl-auth-certificates-in-place @@ -1302,107 +1208,86 @@ IF (PAHO_WITH_SSL) PROPERTIES TIMEOUT 540 ) - ENDIF() -ENDIF() + endif() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test6-static - test6.c - ) - - TARGET_LINK_LIBRARIES( - test6-static - paho-mqtt3a-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test6-static test6.c) + target_link_libraries(test6-static paho-mqtt3a-static) - ADD_TEST( + add_test( NAME test6-restart-recovery-static COMMAND test6-static "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test6-restart-recovery-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test6 - test6.c - ) - - TARGET_LINK_LIBRARIES( - test6 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test6 test6.c) + target_link_libraries(test6 paho-mqtt3a) - ADD_TEST( + add_test( NAME test6-restart-recovery COMMAND test6 "--connection" ${MQTT_TEST_BROKER} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test6-restart-recovery PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test8-static - test8.c - ) - - TARGET_LINK_LIBRARIES( - test8-static - paho-mqtt3a-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test8-static test8.c) + target_link_libraries(test8-static paho-mqtt3a-static) - ADD_TEST( + add_test( NAME test8-1-basic-connect-subscribe-receive-static COMMAND test8-static "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-2-connect-timeout-static COMMAND test8-static "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-3-multiple-client-objects-simultaneous-working-static COMMAND test8-static "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-4-send-receive-big-messages-static COMMAND test8-static "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--size" "500000" ) - ADD_TEST( + add_test( NAME test8-5a-all-ha-connections-out-of-service-static COMMAND test8-static "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-5b-all-ha-connections-out-of-service-except-the-last-one-static COMMAND test8-static "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-5c-all-ha-connections-out-of-service-except-the-first-one-static COMMAND test8-static "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-6-blocked-acks-static COMMAND test8-static "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--size" "500000" ) - SET_TESTS_PROPERTIES( + set_tests_properties( test8-1-basic-connect-subscribe-receive-static test8-2-connect-timeout-static test8-3-multiple-client-objects-simultaneous-working-static @@ -1413,60 +1298,53 @@ IF (PAHO_BUILD_STATIC) test8-6-blocked-acks-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test8 - test8.c - ) - - TARGET_LINK_LIBRARIES( - test8 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test8 test8.c) + target_link_libraries(test8 paho-mqtt3a) - ADD_TEST( + add_test( NAME test8-1-basic-connect-subscribe-receive COMMAND test8 "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-2-connect-timeout COMMAND test8 "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-3-multiple-client-objects-simultaneous-working COMMAND test8 "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-4-send-receive-big-messages COMMAND test8 "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--size" "500000" ) - ADD_TEST( + add_test( NAME test8-5a-all-ha-connections-out-of-service COMMAND test8 "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-5b-all-ha-connections-out-of-service-except-the-last-one COMMAND test8 "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-5c-all-ha-connections-out-of-service-except-the-first-one COMMAND test8 "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} ) - ADD_TEST( + add_test( NAME test8-6-blocked-acks COMMAND test8 "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--size" "500000" ) - SET_TESTS_PROPERTIES( + set_tests_properties( test8-1-basic-connect-subscribe-receive test8-2-connect-timeout test8-3-multiple-client-objects-simultaneous-working @@ -1477,62 +1355,55 @@ IF (PAHO_BUILD_SHARED) test8-6-blocked-acks PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test9-static - test9.c - ) - - TARGET_LINK_LIBRARIES( - test9-static - paho-mqtt3a-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test9-static test9.c) + target_link_libraries(test9-static paho-mqtt3a-static) - ADD_TEST( - NAME test9-1-offline-buffering-send-disconnected-static + add_test( + NAME test9-1-offline-buffering-send-disconnected-static COMMAND test9-static "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-2-offline-buffering-send-disconnected-serverURIs-static COMMAND test9-static "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-3-offline-buffering-auto-reconnect-static COMMAND test9-static "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-4-offline-buffering-auto-reconnect-serverURIs-static COMMAND test9-static "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-5-offline-buffering-max-buffered-static COMMAND test9-static "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-6-offline-buffering-max-buffered-binary-will-static COMMAND test9-static "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( - NAME test9-8-offline-buffering-before-connect-static - COMMAND test9-static "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} - ) + add_test( + NAME test9-8-offline-buffering-before-connect-static + COMMAND test9-static "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} + ) - ADD_TEST( - NAME test9-10-offline-buffering-delete-oldest-messages-static - COMMAND test9-static "--test_no" "10" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} - ) + add_test( + NAME test9-10-offline-buffering-delete-oldest-messages-static + COMMAND test9-static "--test_no" "10" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} + ) - SET_TESTS_PROPERTIES( + set_tests_properties( test9-1-offline-buffering-send-disconnected-static - test9-2-offline-buffering-send-disconnected-serverURIs-static + test9-2-offline-buffering-send-disconnected-serverURIs-static test9-3-offline-buffering-auto-reconnect-static test9-4-offline-buffering-auto-reconnect-serverURIs-static test9-5-offline-buffering-max-buffered-static @@ -1542,47 +1413,47 @@ IF (PAHO_BUILD_STATIC) PROPERTIES TIMEOUT 540 ) - ADD_TEST( + add_test( NAME test9-1ws-offline-buffering-send-disconnected-static COMMAND test9-static "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-2ws-offline-buffering-send-disconnected-serverURIs-static COMMAND test9-static "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-3ws-offline-buffering-auto-reconnect-static COMMAND test9-static "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-4ws-offline-buffering-auto-reconnect-serverURIs-static COMMAND test9-static "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-5ws-offline-buffering-max-buffered-static COMMAND test9-static "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-6ws-offline-buffering-max-buffered-binary-will-static COMMAND test9-static "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-8ws-offline-buffering-before-connect-static COMMAND test9-static "--test_no" "8" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-10ws-offline-buffering-delete-oldest-messages-static COMMAND test9-static "--test_no" "10" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test9-1ws-offline-buffering-send-disconnected-static test9-2ws-offline-buffering-send-disconnected-serverURIs-static test9-3ws-offline-buffering-auto-reconnect-static @@ -1593,60 +1464,53 @@ IF (PAHO_BUILD_STATIC) test9-10ws-offline-buffering-delete-oldest-messages-static PROPERTIES TIMEOUT 540 ) -ENDIF() - -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test9 - test9.c - ) +endif() - TARGET_LINK_LIBRARIES( - test9 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test9 test9.c) + target_link_libraries(test9 paho-mqtt3a) - ADD_TEST( + add_test( NAME test9-1-offline-buffering-send-disconnected COMMAND test9 "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-2-offline-buffering-send-disconnected-serverURIs COMMAND test9 "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-3-offline-buffering-auto-reconnect COMMAND test9 "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-4-offline-buffering-auto-reconnect-serverURIs COMMAND test9 "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-5-offline-buffering-max-buffered COMMAND test9 "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-6-offline-buffering-max-buffered-binary-will COMMAND test9 "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-8-offline-buffering-before-connect COMMAND test9 "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test9-10-offline-buffering-delete-oldest-messages COMMAND test9 "--test_no" "10" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test9-1-offline-buffering-send-disconnected test9-2-offline-buffering-send-disconnected-serverURIs test9-3-offline-buffering-auto-reconnect @@ -1658,101 +1522,94 @@ IF (PAHO_BUILD_SHARED) PROPERTIES TIMEOUT 540 ) - ADD_TEST( - NAME test9-1-ws-offline-buffering-send-disconnected - COMMAND test9 "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) - - ADD_TEST( - NAME test9-2-ws-offline-buffering-send-disconnected-serverURIs - COMMAND test9 "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-1-ws-offline-buffering-send-disconnected + COMMAND test9 "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) + + add_test( + NAME test9-2-ws-offline-buffering-send-disconnected-serverURIs + COMMAND test9 "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test9-3-ws-offline-buffering-auto-reconnect - COMMAND test9 "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-3-ws-offline-buffering-auto-reconnect + COMMAND test9 "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test9-4-ws-offline-buffering-auto-reconnect-serverURIs - COMMAND test9 "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-4-ws-offline-buffering-auto-reconnect-serverURIs + COMMAND test9 "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test9-5-ws-offline-buffering-max-buffered - COMMAND test9 "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-5-ws-offline-buffering-max-buffered + COMMAND test9 "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) + + add_test( + NAME test9-6-ws-offline-buffering-max-buffered-binary-will + COMMAND test9 "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test9-6-ws-offline-buffering-max-buffered-binary-will - COMMAND test9 "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-8-ws-offline-buffering-before-connect + COMMAND test9 "--test_no" "8" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - ADD_TEST( - NAME test9-8-ws-offline-buffering-before-connect - COMMAND test9 "--test_no" "8" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) - - ADD_TEST( - NAME test9-10-ws-offline-buffering-delete-oldest-messages - COMMAND test9 "--test_no" "10" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} - ) + add_test( + NAME test9-10-ws-offline-buffering-delete-oldest-messages + COMMAND test9 "--test_no" "10" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} + ) - SET_TESTS_PROPERTIES( - test9-1-ws-offline-buffering-send-disconnected - test9-2-ws-offline-buffering-send-disconnected-serverURIs - test9-3-ws-offline-buffering-auto-reconnect - test9-4-ws-offline-buffering-auto-reconnect-serverURIs - test9-5-ws-offline-buffering-max-buffered - test9-6-ws-offline-buffering-max-buffered-binary-will - test9-8-ws-offline-buffering-before-connect - test9-10-ws-offline-buffering-delete-oldest-messages - PROPERTIES TIMEOUT 540 - ) -ENDIF() + set_tests_properties( + test9-1-ws-offline-buffering-send-disconnected + test9-2-ws-offline-buffering-send-disconnected-serverURIs + test9-3-ws-offline-buffering-auto-reconnect + test9-4-ws-offline-buffering-auto-reconnect-serverURIs + test9-5-ws-offline-buffering-max-buffered + test9-6-ws-offline-buffering-max-buffered-binary-will + test9-8-ws-offline-buffering-before-connect + test9-10-ws-offline-buffering-delete-oldest-messages + PROPERTIES TIMEOUT 540 + ) +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test95-static - test95.c - ) +if(PAHO_BUILD_STATIC) + add_executable(test95-static test95.c) + target_link_libraries(test95-static paho-mqtt3a-static) - TARGET_LINK_LIBRARIES( - test95-static - paho-mqtt3a-static - ) - - ADD_TEST( + add_test( NAME test95-1-offline-buffering-send-disconnected-static COMMAND test95-static "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-2-offline-buffering-send-disconnected-serverURIs-static COMMAND test95-static "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-3-offline-buffering-auto-reconnect-static COMMAND test95-static "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-4-offline-buffering-auto-reconnect-serverURIs-static COMMAND test95-static "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-5-offline-buffering-max-buffered-static COMMAND test95-static "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-6-offline-buffering-max-buffered-binary-will-static COMMAND test95-static "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test95-1-offline-buffering-send-disconnected-static test95-2-offline-buffering-send-disconnected-serverURIs-static test95-3-offline-buffering-auto-reconnect-static @@ -1762,37 +1619,37 @@ IF (PAHO_BUILD_STATIC) PROPERTIES TIMEOUT 540 ) - ADD_TEST( + add_test( NAME test95-1ws-offline-buffering-send-disconnected-static COMMAND test95-static "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-2ws-offline-buffering-send-disconnected-serverURIs-static COMMAND test95-static "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-3ws-offline-buffering-auto-reconnect-static COMMAND test95-static "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-4ws-offline-buffering-auto-reconnect-serverURIs-static COMMAND test95-static "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-5ws-offline-buffering-max-buffered-static COMMAND test95-static "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-6ws-offline-buffering-max-buffered-binary-will-static COMMAND test95-static "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test95-1ws-offline-buffering-send-disconnected-static test95-2ws-offline-buffering-send-disconnected-serverURIs-static test95-3ws-offline-buffering-auto-reconnect-static @@ -1801,50 +1658,43 @@ IF (PAHO_BUILD_STATIC) test95-6ws-offline-buffering-max-buffered-binary-will-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test95 - test95.c - ) - - TARGET_LINK_LIBRARIES( - test95 - paho-mqtt3a - ) - - ADD_TEST( +if(PAHO_BUILD_SHARED) + add_executable(test95 test95.c) + target_link_libraries(test95 paho-mqtt3a) + + add_test( NAME test95-1-offline-buffering-send-disconnected COMMAND test95 "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-2-offline-buffering-send-disconnected-serverURIs COMMAND test95 "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-3-offline-buffering-auto-reconnect COMMAND test95 "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-4-offline-buffering-auto-reconnect-serverURIs COMMAND test95 "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-5-offline-buffering-max-buffered COMMAND test95 "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-6-offline-buffering-max-buffered-binary-will COMMAND test95 "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test95-1-offline-buffering-send-disconnected test95-2-offline-buffering-send-disconnected-serverURIs test95-3-offline-buffering-auto-reconnect @@ -1854,37 +1704,37 @@ IF (PAHO_BUILD_SHARED) PROPERTIES TIMEOUT 540 ) - ADD_TEST( + add_test( NAME test95-1ws-offline-buffering-send-disconnected COMMAND test95 "--test_no" "1" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-2ws-offline-buffering-send-disconnected-serverURIs COMMAND test95 "--test_no" "2" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-3ws-offline-buffering-auto-reconnect COMMAND test95 "--test_no" "3" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-4ws-offline-buffering-auto-reconnect-serverURIs COMMAND test95 "--test_no" "4" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-5ws-offline-buffering-max-buffered COMMAND test95 "--test_no" "5" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test95-6ws-offline-buffering-max-buffered-binary-will COMMAND test95 "--test_no" "6" "--connection" ${MQTT_WS_TEST_BROKER} "--proxy_connection" ${MQTT_WS_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test95-1ws-offline-buffering-send-disconnected test95-2ws-offline-buffering-send-disconnected-serverURIs test95-3ws-offline-buffering-auto-reconnect @@ -1893,65 +1743,58 @@ IF (PAHO_BUILD_SHARED) test95-6ws-offline-buffering-max-buffered-binary-will PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test10-static - test10.c - ) +if(PAHO_BUILD_STATIC) + add_executable(test10-static test10.c) + target_link_libraries(test10-static paho-mqtt3c-static) - TARGET_LINK_LIBRARIES( - test10-static - paho-mqtt3c-static - ) - - ADD_TEST( + add_test( NAME test10-1-client_topic_aliases-static COMMAND "test10-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-2-server_topic_aliases-static COMMAND "test10-static" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-3-subscription_ids-static COMMAND "test10-static" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-4-flow_control-static COMMAND "test10-static" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-5-error_handling-static COMMAND "test10-static" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-6-qos_1_2_errors-static COMMAND "test10-static" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-7-request_response-static COMMAND "test10-static" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-8-subscribe_options-static COMMAND "test10-static" "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-9-shared_subscriptions-static COMMAND "test10-static" "--test_no" "9" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test10-1-client_topic_aliases-static test10-2-server_topic_aliases-static test10-3-subscription_ids-static @@ -1963,65 +1806,58 @@ IF (PAHO_BUILD_STATIC) test10-9-shared_subscriptions-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test10 - test10.c - ) - - TARGET_LINK_LIBRARIES( - test10 - paho-mqtt3c - ) +if(PAHO_BUILD_SHARED) + add_executable(test10 test10.c) + target_link_libraries(test10 paho-mqtt3c) - ADD_TEST( + add_test( NAME test10-1-client_topic_aliases COMMAND "test10" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-2-server_topic_aliases COMMAND "test10" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-3-subscription_ids COMMAND "test10" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-4-flow_control COMMAND "test10" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-5-error_handling COMMAND "test10" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-6-qos_1_2_errors COMMAND "test10" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-7-request_response COMMAND "test10" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-8-subscribe_options COMMAND "test10" "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test10-9-shared_subscriptions COMMAND "test10" "--test_no" "9" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test10-1-client_topic_aliases test10-2-server_topic_aliases test10-3-subscription_ids @@ -2033,65 +1869,58 @@ IF (PAHO_BUILD_SHARED) test10-9-shared_subscriptions PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test11-static - test11.c - ) +if(PAHO_BUILD_STATIC) + add_executable(test11-static test11.c) + target_link_libraries(test11-static paho-mqtt3a-static) - TARGET_LINK_LIBRARIES( - test11-static - paho-mqtt3a-static - ) - - ADD_TEST( + add_test( NAME test11-1-client_topic_aliases-static COMMAND "test11-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-2-server_topic_aliases-static COMMAND "test11-static" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-3-subscription_ids-static COMMAND "test11-static" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-4-flow_control-static COMMAND "test11-static" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-5-error_handling-static COMMAND "test11-static" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-6-qos_1_2_errors-static COMMAND "test11-static" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-7-request_response-static COMMAND "test11-static" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-8-subscribe_options-static COMMAND "test11-static" "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-9-shared_subscriptions-static COMMAND "test11-static" "--test_no" "9" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test11-1-client_topic_aliases-static test11-2-server_topic_aliases-static test11-3-subscription_ids-static @@ -2103,65 +1932,58 @@ IF (PAHO_BUILD_STATIC) test11-9-shared_subscriptions-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test11 - test11.c - ) - - TARGET_LINK_LIBRARIES( - test11 - paho-mqtt3a - ) +if(PAHO_BUILD_SHARED) + add_executable(test11 test11.c) + target_link_libraries(test11 paho-mqtt3a) - ADD_TEST( + add_test( NAME test11-1-client_topic_aliases COMMAND "test11" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-2-server_topic_aliases COMMAND "test11" "--test_no" "2" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-3-subscription_ids COMMAND "test11" "--test_no" "3" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-4-flow_control COMMAND "test11" "--test_no" "4" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-5-error_handling COMMAND "test11" "--test_no" "5" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-6-qos_1_2_errors COMMAND "test11" "--test_no" "6" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-7-request_response COMMAND "test11" "--test_no" "7" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-8-subscribe_options COMMAND "test11" "--test_no" "8" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - ADD_TEST( + add_test( NAME test11-9-shared_subscriptions COMMAND "test11" "--test_no" "9" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test11-1-client_topic_aliases test11-2-server_topic_aliases test11-3-subscription_ids @@ -2173,118 +1995,78 @@ IF (PAHO_BUILD_SHARED) test11-9-shared_subscriptions PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (NOT PAHO_HIGH_PERFORMANCE) -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test_issue373-static - test_issue373.c - ) - TARGET_LINK_LIBRARIES( - test_issue373-static - paho-mqtt3a-static - ) -ENDIF() +if(NOT PAHO_HIGH_PERFORMANCE) + if(PAHO_BUILD_STATIC) + add_executable(test_issue373-static test_issue373.c) + target_link_libraries(test_issue373-static paho-mqtt3a-static) + endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test_issue373 - test_issue373.c - ) - TARGET_LINK_LIBRARIES( - test_issue373 - paho-mqtt3a - ) -ENDIF() -ENDIF() + if(PAHO_BUILD_SHARED) + add_executable(test_issue373 test_issue373.c) + target_link_libraries(test_issue373 paho-mqtt3a) + endif() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test_sync_session_present-static - test_sync_session_present.c - ) - - TARGET_LINK_LIBRARIES( - test_sync_session_present-static - paho-mqtt3c-static - ) +if(PAHO_BUILD_STATIC) + add_executable(test_sync_session_present-static test_sync_session_present.c) + target_link_libraries(test_sync_session_present-static paho-mqtt3c-static) - ADD_TEST( + add_test( NAME test_sync_session_present-1-client_session_present_after_reconnect-static COMMAND "test_sync_session_present-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test_sync_session_present-1-client_session_present_after_reconnect-static PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test_sync_session_present - test_sync_session_present.c - ) - - TARGET_LINK_LIBRARIES( - test_sync_session_present - paho-mqtt3c - ) +if(PAHO_BUILD_SHARED) + add_executable(test_sync_session_present test_sync_session_present.c) + target_link_libraries(test_sync_session_present paho-mqtt3c) - ADD_TEST( + add_test( NAME test_sync_session_present-1-client_session_present_after_reconnect COMMAND "test_sync_session_present" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} "--proxy_connection" ${MQTT_TEST_PROXY} ) - SET_TESTS_PROPERTIES( + set_tests_properties( test_sync_session_present-1-client_session_present_after_reconnect PROPERTIES TIMEOUT 540 ) -ENDIF() +endif() -IF (PAHO_BUILD_STATIC) - ADD_EXECUTABLE( - test_connect_destroy-static - test_connect_destroy.c - ) +if(PAHO_BUILD_STATIC) + add_executable(test_connect_destroy-static test_connect_destroy.c) + target_link_libraries(test_connect_destroy-static paho-mqtt3c-static) - TARGET_LINK_LIBRARIES( - test_connect_destroy-static - paho-mqtt3c-static - ) - - ADD_TEST( - NAME test_connect_destroy-1-execute-destroy-during-connect-static - COMMAND "test_connect_destroy-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} - ) + add_test( + NAME test_connect_destroy-1-execute-destroy-during-connect-static + COMMAND "test_connect_destroy-static" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} + ) - SET_TESTS_PROPERTIES( - test_connect_destroy-1-execute-destroy-during-connect-static - PROPERTIES TIMEOUT 540 - ) -ENDIF() + set_tests_properties( + test_connect_destroy-1-execute-destroy-during-connect-static + PROPERTIES TIMEOUT 540 + ) +endif() -IF (PAHO_BUILD_SHARED) - ADD_EXECUTABLE( - test_connect_destroy - test_connect_destroy.c - ) - - TARGET_LINK_LIBRARIES( - test_connect_destroy - paho-mqtt3c - ) - - ADD_TEST( - NAME test_connect_destroy-1-execute-destroy-during-connect - COMMAND "test_connect_destroy" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} - ) - - SET_TESTS_PROPERTIES( - test_connect_destroy-1-execute-destroy-during-connect - PROPERTIES TIMEOUT 540 - ) -ENDIF() +if(PAHO_BUILD_SHARED) + add_executable(test_connect_destroy test_connect_destroy.c) + target_link_libraries(test_connect_destroy paho-mqtt3c) + + add_test( + NAME test_connect_destroy-1-execute-destroy-during-connect + COMMAND "test_connect_destroy" "--test_no" "1" "--connection" ${MQTT_TEST_BROKER} + ) + + set_tests_properties( + test_connect_destroy-1-execute-destroy-during-connect + PROPERTIES TIMEOUT 540 + ) +endif() diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt index 0ca81945a..ca8d13378 100644 --- a/test_package/CMakeLists.txt +++ b/test_package/CMakeLists.txt @@ -1,5 +1,5 @@ +cmake_minimum_required(VERSION 3.5) project(test_package C) -cmake_minimum_required(VERSION 2.8.11) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() diff --git a/version.minor b/version.minor index e440e5c84..bf0d87ab1 100644 --- a/version.minor +++ b/version.minor @@ -1 +1 @@ -3 \ No newline at end of file +4 \ No newline at end of file diff --git a/version.patch b/version.patch index 3cacc0b93..c22708346 100644 --- a/version.patch +++ b/version.patch @@ -1 +1 @@ -12 \ No newline at end of file +0 \ No newline at end of file