|
1 | | -cmake_minimum_required(VERSION 3.21) |
| 1 | +cmake_minimum_required(VERSION 3.24) |
2 | 2 |
|
3 | 3 | project(Turing |
4 | 4 | LANGUAGES CXX |
5 | 5 | VERSION 0.2 |
6 | 6 | ) |
7 | 7 |
|
8 | | -set(CMAKE_BUILD_TYPE Debug) |
| 8 | +set(CMAKE_BUILD_TYPE Release) |
9 | 9 |
|
10 | 10 | include(FetchContent) |
11 | 11 |
|
12 | 12 | set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE) |
| 13 | + |
13 | 14 | FetchContent_Declare(ftxui |
14 | 15 | GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui |
15 | | - GIT_TAG v3.0.0 |
| 16 | + GIT_TAG v4.0.0 |
| 17 | + FIND_PACKAGE_ARGS NAMES ftxui |
16 | 18 | ) |
17 | 19 |
|
18 | 20 | FetchContent_Declare(json |
19 | 21 | GIT_REPOSITORY https://github.com/nlohmann/json |
20 | 22 | GIT_TAG v3.10.5 |
| 23 | + FIND_PACKAGE_ARGS NAMES nlohmann_json |
21 | 24 | ) |
22 | 25 |
|
23 | | -FetchContent_GetProperties(json) |
24 | | -if(NOT json_POPULATED) |
25 | | - FetchContent_Populate(json) |
26 | | - add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) |
27 | | -endif() |
28 | | - |
29 | | -FetchContent_GetProperties(ftxui) |
30 | | -if(NOT ftxui_POPULATED) |
31 | | - FetchContent_Populate(ftxui) |
32 | | - add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL) |
33 | | -endif() |
| 26 | +FetchContent_MakeAvailable(ftxui json) |
34 | 27 |
|
35 | 28 | set(CMAKE_CXX_STANDARD 23) |
36 | 29 |
|
37 | 30 | include_directories(include) |
38 | | -#include_directories(${json_SOURCE_DIR}/include) |
39 | 31 |
|
40 | 32 | add_library(TuringLib src/turing.cpp) |
41 | 33 | add_library(TuringUI src/turingUI.cpp) |
42 | 34 | add_library(Translate src/translate.cpp) |
43 | 35 |
|
44 | 36 | target_link_libraries(Translate TuringLib) |
45 | | -#add_library(Utils src/utils.cpp) |
46 | 37 |
|
47 | 38 | target_link_libraries(TuringUI PRIVATE Translate ftxui::screen ftxui::dom ftxui::component TuringLib nlohmann_json::nlohmann_json) |
48 | 39 |
|
49 | | -#target_link_libraries(Utils PRIVATE nlohmann_json::nlohmann_json) |
50 | | - |
51 | 40 | add_executable(turing-cmd src/main.cpp) |
52 | 41 | target_link_libraries(turing-cmd PRIVATE Translate ftxui::screen ftxui::dom ftxui::component TuringLib TuringUI nlohmann_json::nlohmann_json) |
0 commit comments