Add examples compilation
This commit is contained in:
parent
6bb8412e96
commit
32833faec2
3 changed files with 12 additions and 0 deletions
|
@ -64,3 +64,15 @@ if(ENABLE_TESTS)
|
|||
gtest_discover_tests(cserver_tests)
|
||||
endif()
|
||||
|
||||
if(ENABLE_EXAMPLES)
|
||||
file(GLOB EXAMPLES_SRC "examples/src/*.cpp")
|
||||
foreach(EXAMPLE_SRC ${EXAMPLES_SRC})
|
||||
get_filename_component(EXAMPLE_NAME ${EXAMPLE_SRC} NAME_WE)
|
||||
add_executable(${EXAMPLE_NAME} ${EXAMPLE_SRC})
|
||||
target_link_libraries(${EXAMPLE_NAME} cserver)
|
||||
set_property(TARGET ${EXAMPLE_NAME} PROPERTY CXX_STANDARD 23)
|
||||
set_target_properties(${EXAMPLE_NAME} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/examples/output/")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
|
BIN
examples/output/http
Executable file
BIN
examples/output/http
Executable file
Binary file not shown.
Loading…
Reference in a new issue