Skip to content

Commit

Permalink
feat(+doc): added find_package integration
Browse files Browse the repository at this point in the history
  • Loading branch information
DanArmor committed Feb 12, 2023
1 parent 851375a commit b7ad9c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
25 changes: 7 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,52 +1,41 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.24)

project(Turing
LANGUAGES CXX
VERSION 0.2
)

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_TYPE Release)

include(FetchContent)

set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)

FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v3.0.0
GIT_TAG v4.0.0
FIND_PACKAGE_ARGS NAMES ftxui
)

FetchContent_Declare(json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.10.5
FIND_PACKAGE_ARGS NAMES nlohmann_json
)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_MakeAvailable(ftxui json)

set(CMAKE_CXX_STANDARD 23)

include_directories(include)
#include_directories(${json_SOURCE_DIR}/include)

add_library(TuringLib src/turing.cpp)
add_library(TuringUI src/turingUI.cpp)
add_library(Translate src/translate.cpp)

target_link_libraries(Translate TuringLib)
#add_library(Utils src/utils.cpp)

target_link_libraries(TuringUI PRIVATE Translate ftxui::screen ftxui::dom ftxui::component TuringLib nlohmann_json::nlohmann_json)

#target_link_libraries(Utils PRIVATE nlohmann_json::nlohmann_json)

add_executable(turing-cmd src/main.cpp)
target_link_libraries(turing-cmd PRIVATE Translate ftxui::screen ftxui::dom ftxui::component TuringLib TuringUI nlohmann_json::nlohmann_json)
2 changes: 2 additions & 0 deletions README-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

## Установка

Вы можете использовать скомпилированную версию из [релизов](https://github.com/DanArmor/turing_cmd/releases) (пока только для Linux).

<a name="ubuntu-debian"/>

### Ubuntu/Debian:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ You can navigate with keyboard arrows or with mouse, exit by Esc. There are hotk

## Installation:

You can use binaries from [releases](https://github.com/DanArmor/turing_cmd/releases) (Linux only for now).

<a name="ubuntu-debian"/>

### Ubuntu/Debian:
Expand All @@ -74,6 +76,9 @@ There are two deps, but if you have CMake - you're ready to go: make a "build" d
<a name="changelog"/>

## Changelog:

v0.2.1 - FTXUI V4.0.0

v0.2 - moved to nlohmann/json, replaced wchar/wstring with char/string, changed save/load notification, moved to FTXUI V3.0.0

v0.1 - init version

0 comments on commit b7ad9c2

Please sign in to comment.