Skip to content

Commit

Permalink
Add examples to cmake project
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Nov 29, 2024
1 parent 9dda0b3 commit ef14579
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions asio/src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit ef14579

Please sign in to comment.