2 # Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 # Copyright (c) 2021 Richard Hodges (hodges.r@gmail.com)
5 # Distributed under the Boost Software License, Version 1.0. (See accompanying
6 # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 # Official repository: https://github.com/boostorg/json
11 source_group("test" FILES
15 info_grammar_spirit.cpp
20 cmake_parse_arguments("addex" "" "NAME" "SRCS;DEPS" ${ARGN})
21 if("${addex_NAME}" STREQUAL "")
22 message(FATAL_ERROR "add_example: no NAME")
24 if("${addex_SRCS}" STREQUAL "")
25 message(FATAL_ERROR "add_example: no SRCS")
27 message(STATUS "add_example: ${addex_NAME} SRCS: ${addex_SRCS} DEPS: ${addex_DEPS}")
28 add_executable("${PROJECT_NAME}-example-${addex_NAME}"
30 set_property(TARGET "${PROJECT_NAME}-example-${addex_NAME}" PROPERTY FOLDER "example")
31 target_link_libraries("${PROJECT_NAME}-example-${addex_NAME}" PRIVATE ${addex_DEPS})
35 add_example(NAME custom_data_type SRCS custom_data_type.cpp DEPS Boost::property_tree)
36 add_example(NAME debug_settings SRCS debug_settings.cpp DEPS Boost::property_tree)
37 configure_file(debug_settings.xml debug_settings.xml COPYONLY)
38 add_example(NAME empty_ptree_trick SRCS empty_ptree_trick.cpp DEPS Boost::property_tree)
39 add_example(NAME info_grammar_spirit SRCS info_grammar_spirit.cpp DEPS Boost::property_tree)
40 add_example(NAME speed_test SRCS speed_test.cpp DEPS Boost::property_tree)