mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-07-29 20:17:37 +02:00
Add CMake build and client support
This commit is contained in:
committed by
Ivica Siladić
parent
bf81ab5ee7
commit
6abe93fcc9
34
example/CMakeLists.txt
Normal file
34
example/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(async-mqtt5-examples CXX)
|
||||
|
||||
include(../cmake/project-is-top-level.cmake)
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
find_package(async_mqtt5 REQUIRED)
|
||||
endif()
|
||||
|
||||
function(add_example name)
|
||||
add_executable("${name}" ${ARGN})
|
||||
target_compile_features("${name}" PRIVATE cxx_std_20)
|
||||
target_link_libraries("${name}" PRIVATE Async::MQTT5)
|
||||
endfunction()
|
||||
|
||||
foreach(f callbacks cpp20_coroutines futures publisher receiver)
|
||||
add_example("${f}" "${f}.cpp")
|
||||
endforeach()
|
||||
|
||||
#[[
|
||||
add_example(
|
||||
misc
|
||||
src/run_examples.cpp
|
||||
network_connection.cpp
|
||||
openssl-tls.cpp
|
||||
tcp.cpp
|
||||
websocket-tcp.cpp
|
||||
websocket-tls.cpp
|
||||
)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
target_link_libraries(misc PRIVATE OpenSSL::SSL)
|
||||
]]
|
Reference in New Issue
Block a user