-
Notifications
You must be signed in to change notification settings - Fork 0
MQTT module aligning with external module layout #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1e04c3c
updating CMakeLists.txt files according to new module layout
viacheslauK 448cd8d
changes to prevent warnings
viacheslauK 648bfab
boost as a dependency
viacheslauK 5a5a54c
changes to build with preinstalled openDAQ
viacheslauK f196492
ref-dev-mqtt-pub building only if daq::ref_device_module target is pr…
viacheslauK 9c65fd7
preventing rapidjson target re-declaration
viacheslauK 8a6507f
custom rapidjson lib aligned with openDAQ rapidjson lib
viacheslauK bb0179b
gtest as an external dependency
viacheslauK c3eeb07
CMake calls updating
viacheslauK 12a11e3
opendaq_ref updating
viacheslauK 70698dd
OPENDAQ_ALWAYS_FETCH_PAHO_MQTT_C
viacheslauK bd15f93
module_version updating
viacheslauK bcb8377
updated ci
viacheslauK 51c61ce
unused variables
viacheslauK ce16a79
remove compile definition
viacheslauK d8483cb
cast fix
viacheslauK 81b2f49
Param tests reworking (SignalHelper is moved inside tests)
viacheslauK bf41a55
uninitialized field
viacheslauK 100e65c
std::async for SignalHelper::send in tests
viacheslauK c1fdfe2
uninitialized bool
viacheslauK 5efcb2e
disable msvc warnings for paho lib
viacheslauK 102413c
Update .github/workflows/ci.yml
viacheslauK 63c0ffc
unused variables
viacheslauK 3a2da60
Fix false positive memleak detection and extend CI (#12)
NikolaiShipilov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,77 +1,95 @@ | ||
| # CMakeList.txt : CMake project for MQTTStreamingModule, include source and define | ||
| # project specific logic here. | ||
| # | ||
| set(CMAKE_POLICY_VERSION_MINIMUM 3.5) | ||
| set(CMAKE_POLICY_VERSION_MINIMUM 3.5) | ||
| cmake_minimum_required(VERSION 3.25) | ||
|
|
||
| set(SDK_TARGET_NAMESPACE daq) | ||
| set(REPO_NAME mqtt_module) | ||
| set(REPO_OPTION_PREFIX MQTT_MODULE) | ||
| set(REPO_NAME MqttModule) | ||
| set(REPO_OPTION_PREFIX DAQMODULES_MQTT) | ||
| set(CMAKE_FOLDER "${CMAKE_FOLDER}/${REPO_NAME}") | ||
|
|
||
| project (${REPO_NAME} CXX) | ||
| list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME}) | ||
| add_subdirectory(cmake) | ||
|
|
||
| # Enable Hot Reload for MSVC compilers if supported. | ||
| if (POLICY CMP0141) | ||
| cmake_policy(SET CMP0141 NEW) | ||
| set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>") | ||
| endif() | ||
| opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/module_version" module_version) | ||
| opendaq_get_version_major_minor_patch("${module_version}" ${REPO_OPTION_PREFIX}_VERSION) | ||
|
|
||
| if (POLICY CMP0135) | ||
| cmake_policy(SET CMP0135 NEW) | ||
| # the following section is required if module-project being built standalone with 32bit arch, it is "temporary" workaround, though - the correct one would be using `-DCMAKE_TOOLCHAIN_FILE` | ||
| # 32-bit Linux cross-compilation setup (must be before any project()) | ||
| if (NOT DEFINED PROJECT_SOURCE_DIR AND OPENDAQ_FORCE_COMPILE_32BIT AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") | ||
| opendaq_32bit_build_linux_early_setup() | ||
| endif() | ||
|
|
||
| if (POLICY CMP0077) | ||
| cmake_policy(SET CMP0077 NEW) | ||
| endif() | ||
| project(${REPO_NAME} VERSION ${${REPO_OPTION_PREFIX}_VERSION} LANGUAGES CXX) | ||
|
|
||
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
| list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME}) | ||
| set(CMAKE_MESSAGE_CONTEXT_SHOW ON CACHE BOOL "Show CMake message context") | ||
| opendaq_common_early_setup() | ||
|
|
||
| list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
| if (PROJECT_IS_TOP_LEVEL) | ||
| message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} standalone") | ||
| else() | ||
| message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} as submodule") | ||
| endif() | ||
|
|
||
| option(OPENDAQ_MQTT_MODULE_ENABLE_SSL "Enable building with openSSL" OFF) | ||
| option(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS "Enable building example applications" OFF) | ||
| # options | ||
| opendaq_setup_common_build_options() | ||
| opendaq_setup_project_specific_build_options(${REPO_OPTION_PREFIX}) | ||
| option(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP "Enable ${REPO_NAME} example applications" ${PROJECT_IS_TOP_LEVEL}) | ||
| option(${REPO_OPTION_PREFIX}_ENABLE_TESTS "Enable ${REPO_NAME} testing" ${PROJECT_IS_TOP_LEVEL}) | ||
| option(${REPO_OPTION_PREFIX}_ENABLE_SSL "Enable building with openSSL" OFF) | ||
|
|
||
| if ((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) AND NOT MSVC) | ||
| if (NOT WIN32) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") | ||
| endif() | ||
| add_compile_options(-Wno-deprecated-declarations) | ||
| endif() | ||
| opendaq_common_compile_targets_settings() | ||
| opendaq_setup_compiler_flags(${REPO_OPTION_PREFIX}) | ||
|
|
||
| include(CommonUtils) | ||
| setup_repo(${REPO_OPTION_PREFIX}) | ||
| if (${REPO_OPTION_PREFIX}_ENABLE_TESTS) | ||
| message(STATUS "Unit tests in ${REPO_NAME} are ENABLED") | ||
| enable_testing() | ||
| else() | ||
| message(STATUS "Unit tests in ${REPO_NAME} are DISABLED") | ||
| endif() | ||
|
|
||
| if(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS) | ||
| if(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP) | ||
| set(DAQMODULES_REF_DEVICE_MODULE ON CACHE BOOL "" FORCE) | ||
| endif() | ||
|
|
||
| option(OPENDAQ_MQTT_ENABLE_TESTS "Enable module testing" OFF) | ||
| option(OPENDAQ_MQTT_ENABLE_EXAMPLE_APPS "Enable example applications building" OFF) | ||
|
|
||
| if(OPENDAQ_MQTT_MODULE_ENABLE_SSL) | ||
| if(${REPO_OPTION_PREFIX}_ENABLE_SSL) | ||
| find_package(OpenSSL REQUIRED) | ||
| if (OPENSSL_FOUND) | ||
| message(STATUS "Found OpenSSL ${OPENSSL_VERSION}") | ||
| else() | ||
| message(FATAL_ERROR "OpenSSL Not Found") | ||
| endif() | ||
| add_compile_definitions(OPENDAQ_MQTT_MODULE_ENABLE_SSL) | ||
| add_compile_definitions(${REPO_OPTION_PREFIX}_ENABLE_SSL) | ||
| endif() | ||
|
|
||
| set(MQTT_MODULE_VERSION "0.1.0" CACHE STRING "MQTT module version" FORCE) | ||
|
|
||
| if(OPENDAQ_MQTT_ENABLE_TESTS) | ||
| enable_testing() | ||
| if (NOT TARGET "${OPENDAQ_SDK_TARGET_NAMESPACE}::${OPENDAQ_SDK_TARGET_NAME}") | ||
| if (PROJECT_IS_TOP_LEVEL) | ||
| find_package(${OPENDAQ_SDK_NAME} GLOBAL) | ||
| endif() | ||
| if (NOT ${OPENDAQ_SDK_NAME}_FOUND) | ||
| include(FetchContent) | ||
| set(OPENDAQ_ENABLE_TESTS OFF CACHE BOOL "") | ||
|
|
||
| opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/opendaq_ref" OPENDAQ_REF) | ||
| opendaq_get_custom_fetch_content_params(${OPENDAQ_SDK_NAME} FC_PARAMS) | ||
|
|
||
| FetchContent_Declare( | ||
| ${OPENDAQ_SDK_NAME} | ||
| GIT_REPOSITORY https://github.com/openDAQ/openDAQ.git | ||
| GIT_TAG ${OPENDAQ_REF} | ||
| GIT_PROGRESS ON | ||
| ${FC_PARAMS} | ||
| ) | ||
| FetchContent_MakeAvailable(${OPENDAQ_SDK_NAME}) | ||
| else() | ||
| message(STATUS "Found installed ${OPENDAQ_SDK_NAME} version: ${${OPENDAQ_SDK_NAME}_VERSION}") | ||
| set(OPENDAQ_PACKAGE_VERSION "${${OPENDAQ_SDK_NAME}_VERSION}" CACHE INTERNAL "${OPENDAQ_SDK_NAME} SDK version") | ||
| endif() | ||
| endif() | ||
|
|
||
| add_subdirectory(external) | ||
| add_subdirectory(shared) | ||
| add_subdirectory(modules) | ||
|
|
||
| if(OPENDAQ_DEVICE_EXAMPLE_ENABLE_EXAMPLE_APPS) | ||
| message(STATUS "Example applications have been enabled") | ||
| if(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP) | ||
| message(STATUS "Example applications in ${REPO_NAME} are ENABLED") | ||
| add_subdirectory(examples) | ||
| else() | ||
| message(STATUS "Example applications in ${REPO_NAME} are DISABLED") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| set(CMAKE_FOLDER "cmake") | ||
|
|
||
| list(APPEND CMAKE_MESSAGE_CONTEXT cmake) | ||
| set(CURR_MESSAGE_CONTEXT ${CMAKE_MESSAGE_CONTEXT}) | ||
|
|
||
| message(STATUS "Import functions and macro from opendaq-cmake-utils repo") | ||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| opendaq-cmake-utils | ||
| GIT_REPOSITORY https://github.com/openDAQ/opendaq-cmake-utils.git | ||
| GIT_TAG v1.0.0 | ||
| GIT_PROGRESS ON | ||
| ) | ||
| FetchContent_MakeAvailable(opendaq-cmake-utils) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.