]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
1 | # |
2 | # Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) | |
3 | # | |
4 | # Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | # | |
7 | # Official repository: https://github.com/boostorg/json | |
8 | # | |
9 | ||
10 | file(GLOB_RECURSE BOOST_JSON_TESTS_FILES CONFIGURE_DEPENDS Jamfile *.cpp *.hpp) | |
11 | list(FILTER BOOST_JSON_TESTS_FILES EXCLUDE REGEX "^${CMAKE_CURRENT_SOURCE_DIR}/cmake_install_test/.*$") | |
12 | ||
13 | source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${BOOST_JSON_TESTS_FILES}) | |
14 | add_executable(tests ${BOOST_JSON_TESTS_FILES}) | |
15 | target_include_directories(tests PRIVATE .) | |
16 | target_link_libraries(tests PRIVATE Boost::json) | |
17 | add_test(NAME json-tests COMMAND tests) | |
18 | ||
19 | source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES limits.cpp main.cpp) | |
20 | source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../src PREFIX "" FILES ../src/src.cpp) | |
21 | add_executable(limits limits.cpp main.cpp ../src/src.cpp Jamfile) | |
22 | ||
23 | target_compile_features(limits PUBLIC cxx_constexpr) | |
24 | ||
25 | target_include_directories(limits PRIVATE ../include .) | |
26 | target_compile_definitions(limits PRIVATE | |
27 | BOOST_JSON_MAX_STRING_SIZE=1000 | |
28 | BOOST_JSON_MAX_STRUCTURED_SIZE=20 | |
29 | BOOST_JSON_STACK_BUFFER_SIZE=256 | |
30 | BOOST_JSON_NO_LIB=1 | |
31 | ) | |
32 | ||
33 | if(BOOST_JSON_STANDALONE) | |
34 | target_compile_definitions(limits PRIVATE BOOST_JSON_STANDALONE) | |
35 | target_compile_features(limits PRIVATE cxx_std_17) | |
36 | elseif(BOOST_SUPERPROJECT_VERSION) | |
37 | target_link_libraries(limits | |
38 | PRIVATE | |
39 | Boost::align | |
40 | Boost::assert | |
41 | Boost::config | |
42 | Boost::container | |
43 | Boost::exception | |
44 | Boost::system | |
45 | Boost::throw_exception | |
46 | Boost::utility | |
47 | ) | |
48 | elseif(BOOST_JSON_IN_BOOST_TREE) | |
49 | target_include_directories(limits PRIVATE ${BOOST_ROOT}) | |
50 | target_link_directories(limits PRIVATE ${BOOST_ROOT}/stage/lib) | |
51 | else() | |
52 | target_link_libraries(limits | |
53 | PRIVATE | |
54 | Boost::system | |
55 | Boost::container | |
56 | ) | |
57 | endif() | |
58 | ||
59 | add_test(NAME json-limits COMMAND limits) |