1- update_submodule(nonstd/expected-lite)
2- add_subdirectory (thirdparty/nonstd/expected-lite EXCLUDE_FROM_ALL )
1+ include (FetchContent)
32
4- update_submodule(nonstd/variant-lite)
5- add_subdirectory (thirdparty/nonstd/variant-lite EXCLUDE_FROM_ALL )
3+ FetchContent_Declare(
4+ expected-lite
5+ GIT_REPOSITORY https://github.com/martinmoene/expected-lite.git
6+ GIT_TAG master
7+ )
8+ FetchContent_MakeAvailable(expected-lite)
69
7- update_submodule(nonstd/optional -lite)
8- add_subdirectory (thirdparty/nonstd/optional -lite EXCLUDE_FROM_ALL )
10+ FetchContent_Declare(
11+ variant-lite
12+ GIT_REPOSITORY https://github.com/martinmoene/variant-lite.git
13+ GIT_TAG master
14+ )
15+ FetchContent_MakeAvailable(variant-lite)
916
10- update_submodule(nonstd/string -view-lite)
11- add_subdirectory (thirdparty/nonstd/string -view-lite EXCLUDE_FROM_ALL )
17+ FetchContent_Declare(
18+ optional -lite
19+ GIT_REPOSITORY https://github.com/martinmoene/optional -lite.git
20+ GIT_TAG master
21+ )
22+ FetchContent_MakeAvailable(optional -lite)
23+
24+ FetchContent_Declare(
25+ string -view-lite
26+ GIT_REPOSITORY https://github.com/martinmoene/string -view-lite.git
27+ GIT_TAG master
28+ )
29+ FetchContent_MakeAvailable(string -view-lite)
1230
13- update_submodule(fmtlib)
1431set (FMT_INSTALL ON CACHE BOOL "" FORCE)
15- add_subdirectory (thirdparty/fmtlib EXCLUDE_FROM_ALL )
32+ FetchContent_Declare(
33+ fmt
34+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git
35+ GIT_TAG 10.1.1
36+ )
37+ FetchContent_MakeAvailable(fmt)
1638
17- update_submodule(json/rapid)
1839set (RAPIDJSON_BUILD_DOC OFF CACHE BOOL "" FORCE)
1940set (RAPIDJSON_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
2041set (RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "" FORCE)
2142set (RAPIDJSON_BUILD_THIRDPARTY_GTEST OFF CACHE BOOL "" FORCE)
2243set (RAPIDJSON_ENABLE_INSTRUMENTATION_OPT OFF CACHE BOOL "" FORCE)
23- add_subdirectory (thirdparty/json/rapid EXCLUDE_FROM_ALL )
24- find_package (RapidJSON)
44+
45+ FetchContent_Declare(
46+ rapidjson
47+ GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
48+ GIT_TAG 973dc9c06dcd3d035ebd039cfb9ea457721ec213
49+ )
50+ # GIT_TAG f9d53419e912910fd8fa57d5705fa41425428c35 - latest but broken revision
51+ FetchContent_MakeAvailable(rapidjson)
52+ find_package (RapidJSON REQUIRED)
2553add_library (RapidJson INTERFACE )
2654target_include_directories (RapidJson
2755 INTERFACE
2856 $<BUILD_INTERFACE:${RapidJSON_INCLUDE_DIR} >
2957 $<INSTALL_INTERFACE:include >
30- )
31-
58+ )
3259if (JINJA2CPP_BUILD_TESTS)
33- update_submodule(json/nlohmann)
3460 set (JSON_BuildTests OFF CACHE BOOL "" FORCE)
3561 set (JSON_Install OFF CACHE BOOL "" FORCE)
3662 set (JSON_MultipleHeaders ON CACHE BOOL "" FORCE)
37- add_subdirectory (thirdparty/json/nlohmann EXCLUDE_FROM_ALL )
63+
64+ FetchContent_Declare(
65+ nlohmann_json
66+ GIT_REPOSITORY https://github.com/nlohmann/json.git
67+ GIT_TAG develop
68+ )
69+ FetchContent_MakeAvailable(nlohmann_json)
3870endif ()
3971
4072install (FILES
@@ -49,4 +81,4 @@ install (TARGETS RapidJson
4981 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
5082 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
5183 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} /static
52- )
84+ )
0 commit comments