C++ boost::leaf examples
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
659 B

cmake_minimum_required(VERSION 3.21)
project(leaf_examples LANGUAGES CXX)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Boost CONFIG COMPONENTS leaf)
if(NOT TARGET Boost::leaf)
find_package(Boost REQUIRED)
set(LEAF_TARGET Boost::headers)
else()
set(LEAF_TARGET Boost::leaf)
endif()
set(EXAMPLES
leaf_on_error_example
leaf_mutable_block
leaf_universal_handler
)
foreach(example IN LISTS EXAMPLES)
add_executable(${example} src/${example}.cpp)
target_link_libraries(${example} PRIVATE ${LEAF_TARGET})
endforeach()
install(
TARGETS ${EXAMPLES}
RUNTIME DESTINATION bin
)