-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d89dc7
commit 9cb3297
Showing
8 changed files
with
21 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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,3 @@ | ||
[submodule "cpp-tools"] | ||
path = cpp-tools | ||
url = git@github.com:Wolkabout/cpp-tools.git |
This file contains 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 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 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 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,92 +1,4 @@ | ||
# Include the CMake modules | ||
include(ExternalProject) | ||
include(FetchContent) | ||
|
||
# Define the versions | ||
set(PAHO_MQTT_C_VERSION 1.3.8) | ||
set(PAHO_MQTT_CPP_VERSION 1.2.0) | ||
set(NLOHMANN_JSON_VERSION_PREFIX 3.7) | ||
set(NLOHMANN_JSON_VERSION 3.7.3) | ||
set(JSON_SCHEMA_VERSION 2.1.0) | ||
|
||
# Include PahoMQTT for both C and C++ | ||
ExternalProject_Add(pahomqttc | ||
GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c" | ||
GIT_TAG v${PAHO_MQTT_C_VERSION} | ||
UPDATE_COMMAND "" | ||
CMAKE_ARGS | ||
# Options for pahomqttc | ||
-DPAHO_WITH_SSL=ON | ||
-DPAHO_BUILD_SHARED=ON | ||
-DPAHO_BUILD_STATIC=OFF | ||
-DPAHO_BUILD_DOCUMENTATION=OFF | ||
-DPAHO_BUILD_SAMPLES=OFF | ||
-DPAHO_BUILD_DEB_PACKAGE=OFF | ||
-DPAHO_ENABLE_TESTING=OFF | ||
-DPAHO_ENABLE_CPACK=OFF | ||
|
||
# Target path for installation | ||
-DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} | ||
|
||
# In case the library needs to cross-compile | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | ||
-DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} | ||
) | ||
|
||
ExternalProject_Add(pahomqttcpp | ||
GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.cpp" | ||
GIT_TAG v${PAHO_MQTT_CPP_VERSION} | ||
UPDATE_COMMAND "" | ||
CMAKE_ARGS | ||
# Options for pahomqttcpp | ||
-DPAHO_WITH_SSL=ON | ||
-DPAHO_BUILD_SHARED=ON | ||
-DPAHO_BUILD_STATIC=OFF | ||
-DPAHO_BUILD_DOCUMENTATION=OFF | ||
-DPAHO_BUILD_SAMPLES=OFF | ||
-DPAHO_BUILD_DEB_PACKAGE=OFF | ||
-DPAHO_BUILD_TESTS=OFF | ||
|
||
# Target path for installation | ||
-DPAHO_MQTT_C_INCLUDE_DIRS=${CMAKE_PREFIX_PATH}/include | ||
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} | ||
-DCMAKE_INSTALL_PREFIX=${CMAKE_PREFIX_PATH} | ||
|
||
# In case the library needs to cross-compile | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} | ||
-DARP_TOOLCHAIN_ROOT=${ARP_TOOLCHAIN_ROOT} | ||
DEPENDS pahomqttc | ||
) | ||
|
||
# Set JSON flags | ||
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." OFF) | ||
|
||
# Include nlohmann json and the schema) | ||
FetchContent_Declare( | ||
nlohmann_json | ||
GIT_REPOSITORY https://github.com/nlohmann/json | ||
GIT_TAG v${NLOHMANN_JSON_VERSION} | ||
FIND_PACKAGE_ARGS ${NLOHMANN_JSON_VERSION_PREFIX} NAMES nlohmann-json3-dev | ||
) | ||
|
||
# Save the flags, for reset after we run the cmake for schema | ||
set(_BUILD_TESTS ${BUILD_TESTS}) | ||
set(_BUILD_EXAMPLES ${BUILD_EXAMPLES}) | ||
set(BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE) | ||
set(BUILD_EXAMPLES OFF CACHE BOOL "Build examples" FORCE) | ||
|
||
FetchContent_Declare( | ||
json-schema | ||
GIT_REPOSITORY https://github.com/pboettch/json-schema-validator | ||
GIT_TAG ${JSON_SCHEMA_VERSION} | ||
) | ||
|
||
# Make everything available | ||
FetchContent_MakeAvailable(nlohmann_json json-schema) | ||
|
||
# Reset the flags for schema | ||
set(BUILD_TESTS ${_BUILD_TESTS} CACHE BOOL "Build tests" FORCE) | ||
set(BUILD_EXAMPLES ${_BUILD_EXAMPLES} CACHE BOOL "Build examples" FORCE) | ||
|
||
# Adjust the compile options for `nlohmann_json` to disable the shadow and pedantic | ||
target_compile_options(nlohmann_json_schema_validator PRIVATE "-Wno-shadow;-Wno-pedantic") | ||
include(../cpp-tools/cmake/dependencies/paho_mqtt_c.cmake) | ||
include(../cpp-tools/cmake/dependencies/paho_mqtt_cpp.cmake) | ||
include(../cpp-tools/cmake/dependencies/nlohmann_json.cmake) | ||
include(../cpp-tools/cmake/dependencies/json_schema_validator.cmake) |
This file contains 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,18 +1 @@ | ||
# Include the CMake modules | ||
include(FetchContent) | ||
|
||
# Define the gtest/gmock version | ||
set(GTEST_VERSION 1.10.0) | ||
|
||
# Add gtest/gmock | ||
FetchContent_Declare( | ||
libgtest | ||
GIT_REPOSITORY https://github.com/google/googletest | ||
GIT_TAG release-${GTEST_VERSION} | ||
) | ||
|
||
# Make available | ||
FetchContent_MakeAvailable(libgtest) | ||
|
||
# Adjust the compile options for `nlohmann_json` to disable the compilation errors with our flags | ||
target_compile_options(gtest PRIVATE "-Wno-error=maybe-uninitialized;-Wno-error=suggest-attribute=noreturn") | ||
include(../../cpp-tools/cmake/dependencies/gtest.cmake) |
This file contains 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,19 +1,5 @@ | ||
# Include the CMake modules | ||
include(FetchContent) | ||
include(../cpp-tools/cmake/dependencies/spdlog.cmake) | ||
include(../cpp-tools/cmake/dependencies/openssl_crypto.cmake) | ||
|
||
# Add the pre-installed libraries | ||
find_package(OpenSSL REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
# Define the spdlog version | ||
set(SPDLOG_VERSION 1.8.5) | ||
|
||
# Add spdlog | ||
FetchContent_Declare( | ||
spdlog | ||
GIT_REPOSITORY https://github.com/gabime/spdlog | ||
GIT_TAG v${SPDLOG_VERSION} | ||
) | ||
|
||
# Make available | ||
FetchContent_MakeAvailable(spdlog) |