From ef145792b4acc0f5de1a64d8692be4342fa86e72 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 29 Nov 2024 19:09:45 +0100 Subject: [PATCH] Add examples to cmake project --- asio/src/examples/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 asio/src/examples/CMakeLists.txt diff --git a/asio/src/examples/CMakeLists.txt b/asio/src/examples/CMakeLists.txt new file mode 100644 index 0000000000..c524405a7f --- /dev/null +++ b/asio/src/examples/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.25...3.31) + +project(asio_examples LANGUAGES CXX) + +if(PROJECT_IS_TOP_LEVEL) + find_package(asio 1.32.0.1 EXACT REQUIRED) + enable_testing() +endif() + +set(ALL_EXAMPLES callback_wrapper) + +message(STATUS "Examples to be built: ${ALL_EXAMPLES}") + +foreach(example ${ALL_EXAMPLES}) + add_executable(${example}) + target_sources(${example} PRIVATE cpp20/operations/${example}.cpp) + target_link_libraries(${example} asio::asio_header) + add_test(NAME ${example} COMMAND echo Test | ${example}) +endforeach()