Commit 710de811 authored by Dominik Charousset's avatar Dominik Charousset

Add CMake scaffold example applications

parent fb6e8bef
......@@ -28,6 +28,7 @@ option(CAF_INC_ENABLE_STANDALONE_BUILD
option(CAF_INC_ENABLE_TESTING "Build unit test suites" ON)
option(CAF_INC_ENABLE_NET_MODULE "Build networking module" ON)
option(CAF_INC_ENABLE_BB_MODULE "Build building blocks module" ON)
option(CAF_INC_ENABLE_EXAMPLES "Build small programs" ON)
# -- incubator options with non-boolean values ---------------------------------
......@@ -205,3 +206,7 @@ endif()
if(CAF_INC_ENABLE_NET_MODULE)
add_subdirectory(libcaf_bb)
endif()
if(CAF_INC_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
add_custom_target(all_examples)
function(add_example folder name)
add_executable(${name} ${folder}/${name}.cpp ${ARGN})
install(FILES ${folder}/${name}.cpp DESTINATION ${CMAKE_INSTALL_DATADIR}/caf/examples/${folder})
add_dependencies(${name} all_examples)
endfunction()
# -- examples for CAF::net -----------------------------------------------------
if(TARGET CAF::net)
function(add_net_example name)
add_example("net" ${name} ${ARGN})
target_link_libraries(${name} CAF::net CAF::core)
endfunction()
endif()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment