FTXUI/CMakeLists.txt

194 lines
5.5 KiB
CMake
Raw Normal View History

2023-05-19 18:11:12 +08:00
cmake_minimum_required(VERSION 3.12)
2020-08-09 20:53:56 +08:00
project(ftxui
LANGUAGES CXX
2023-08-19 21:46:36 +08:00
VERSION 5.0.0
DESCRIPTION "C++ Functional Terminal User Interface."
)
2019-01-03 07:35:59 +08:00
option(FTXUI_QUIET "Set to ON for FTXUI to be quiet" OFF)
2024-06-26 00:36:25 +08:00
option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" ON)
option(FTXUI_BUILD_DOCS "Set to ON to build docs" OFF)
2020-04-17 05:20:04 +08:00
option(FTXUI_BUILD_TESTS "Set to ON to build tests" OFF)
option(FTXUI_BUILD_TESTS_FUZZER "Set to ON to enable fuzzing" OFF)
option(FTXUI_ENABLE_INSTALL "Generate the install target" ON)
2022-03-31 08:17:43 +08:00
option(FTXUI_CLANG_TIDY "Execute clang-tidy" OFF)
2022-04-17 21:47:20 +08:00
option(FTXUI_ENABLE_COVERAGE "Execute code coverage" OFF)
option(FTXUI_DEV_WARNINGS "Enable more compiler warnings and warnings as errors" OFF)
2018-09-18 14:48:40 +08:00
Implement Fallback for microsoft's terminals. (#138) I finally got access to a computer using the Microsoft's Windows OS. That's the opportunity to find and mitigate all the problems encountered. This patch: 1. Introduce an option and a C++ definition to enable fallback for Microsoft's terminal emulators. This allows me to see/test the Microsoft output from Linux. This also allows Windows users to remove the fallback and target non Microsoft terminals on Windows if needed. 2. Microsoft's terminal suffer from a race condition bug when reporting the cursor position: https://github.com/microsoft/terminal/pull/7583. The mitigation is not to ask for the cursor position in fullscreen mode where it isn't really needed and request it less often. This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/136 3. Microsoft's terminal do not handle properly hidding the cursor. Instead the character under the cursor is hidden, which is a big problem. As a result, we don't enable setting the cursor to the best position for [input method editors](https://en.wikipedia.org/wiki/Input_method), It will be displayed at the bottom right corner. See: - https://github.com/microsoft/terminal/issues/1203 - https://github.com/microsoft/terminal/issues/3093 4. Microsoft's terminals do not provide a way to query if they support colors. As a fallback, assume true colors is supported. See issue: - https://github.com/microsoft/terminal/issues/1040 This mitigates: - https://github.com/ArthurSonzogni/FTXUI/issues/135 5. The "cmd" on Windows do not properly report its dimension. Powershell works correctly. As a fallback, use a 80x80 size instead of 0x0. 6. There are several dom elements and component displayed incorrectly, because the font used is missing several unicode glyph. Use alternatives or less detailled one as a fallback.
2021-07-04 23:38:31 +08:00
set(FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT "On windows, assume the \
terminal used will be one of Microsoft and use a set of reasonnable fallback \
to counteract its implementations problems.")
if (WIN32)
option(FTXUI_MICROSOFT_TERMINAL_FALLBACK
${FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT} ON)
else()
option(FTXUI_MICROSOFT_TERMINAL_FALLBACK
${FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT} OFF)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(cmake/ftxui_message.cmake)
2022-03-31 08:17:43 +08:00
add_library(screen
include/ftxui/screen/box.hpp
include/ftxui/screen/color.hpp
include/ftxui/screen/color_info.hpp
include/ftxui/screen/image.hpp
include/ftxui/screen/pixel.hpp
include/ftxui/screen/screen.hpp
include/ftxui/screen/string.hpp
src/ftxui/screen/box.cpp
src/ftxui/screen/color.cpp
2020-09-06 19:43:24 +08:00
src/ftxui/screen/color_info.cpp
src/ftxui/screen/image.cpp
src/ftxui/screen/screen.cpp
src/ftxui/screen/string.cpp
src/ftxui/screen/terminal.cpp
src/ftxui/screen/util.hpp
)
add_library(dom
include/ftxui/dom/canvas.hpp
include/ftxui/dom/direction.hpp
include/ftxui/dom/elements.hpp
include/ftxui/dom/flexbox_config.hpp
include/ftxui/dom/node.hpp
include/ftxui/dom/requirement.hpp
include/ftxui/dom/take_any_args.hpp
2022-02-13 18:41:31 +08:00
src/ftxui/dom/automerge.cpp
src/ftxui/dom/blink.cpp
src/ftxui/dom/bold.cpp
src/ftxui/dom/hyperlink.cpp
src/ftxui/dom/border.cpp
src/ftxui/dom/box_helper.cpp
src/ftxui/dom/box_helper.hpp
src/ftxui/dom/canvas.cpp
src/ftxui/dom/clear_under.cpp
src/ftxui/dom/color.cpp
src/ftxui/dom/composite_decorator.cpp
src/ftxui/dom/dbox.cpp
src/ftxui/dom/dim.cpp
src/ftxui/dom/flex.cpp
src/ftxui/dom/flexbox.cpp
src/ftxui/dom/flexbox_config.cpp
src/ftxui/dom/flexbox_helper.cpp
src/ftxui/dom/flexbox_helper.hpp
src/ftxui/dom/focus.cpp
src/ftxui/dom/frame.cpp
src/ftxui/dom/gauge.cpp
src/ftxui/dom/graph.cpp
src/ftxui/dom/gridbox.cpp
src/ftxui/dom/hbox.cpp
src/ftxui/dom/inverted.cpp
src/ftxui/dom/linear_gradient.cpp
src/ftxui/dom/node.cpp
src/ftxui/dom/node_decorator.cpp
src/ftxui/dom/paragraph.cpp
src/ftxui/dom/reflect.cpp
src/ftxui/dom/scroll_indicator.cpp
src/ftxui/dom/separator.cpp
src/ftxui/dom/size.cpp
src/ftxui/dom/spinner.cpp
src/ftxui/dom/strikethrough.cpp
src/ftxui/dom/table.cpp
src/ftxui/dom/text.cpp
src/ftxui/dom/underlined.cpp
src/ftxui/dom/underlined_double.cpp
src/ftxui/dom/util.cpp
src/ftxui/dom/vbox.cpp
)
add_library(component
2022-03-14 01:51:46 +08:00
include/ftxui/component/animation.hpp
include/ftxui/component/captured_mouse.hpp
2020-08-26 22:26:09 +08:00
include/ftxui/component/component.hpp
2021-05-10 02:32:27 +08:00
include/ftxui/component/component_base.hpp
2022-03-14 01:51:46 +08:00
include/ftxui/component/component_options.hpp
2020-08-26 22:26:09 +08:00
include/ftxui/component/event.hpp
include/ftxui/component/loop.hpp
2021-04-25 21:22:38 +08:00
include/ftxui/component/mouse.hpp
2020-08-26 22:26:09 +08:00
include/ftxui/component/receiver.hpp
include/ftxui/component/screen_interactive.hpp
include/ftxui/component/task.hpp
2022-03-14 01:51:46 +08:00
src/ftxui/component/animation.cpp
2020-08-26 22:26:09 +08:00
src/ftxui/component/button.cpp
2021-05-23 18:53:20 +08:00
src/ftxui/component/catch_event.cpp
src/ftxui/component/checkbox.cpp
2022-01-02 22:48:56 +08:00
src/ftxui/component/collapsible.cpp
src/ftxui/component/component.cpp
2022-03-14 01:51:46 +08:00
src/ftxui/component/component_options.cpp
src/ftxui/component/container.cpp
src/ftxui/component/dropdown.cpp
src/ftxui/component/event.cpp
src/ftxui/component/hoverable.cpp
src/ftxui/component/input.cpp
src/ftxui/component/loop.cpp
src/ftxui/component/maybe.cpp
src/ftxui/component/menu.cpp
src/ftxui/component/modal.cpp
src/ftxui/component/radiobox.cpp
2020-03-27 06:15:52 +08:00
src/ftxui/component/radiobox.cpp
2021-05-13 17:44:47 +08:00
src/ftxui/component/renderer.cpp
2021-05-27 21:22:53 +08:00
src/ftxui/component/resizable_split.cpp
src/ftxui/component/screen_interactive.cpp
2021-04-29 06:18:58 +08:00
src/ftxui/component/slider.cpp
src/ftxui/component/terminal_input_parser.cpp
src/ftxui/component/terminal_input_parser.hpp
src/ftxui/component/util.cpp
src/ftxui/component/window.cpp
)
target_link_libraries(dom
PUBLIC screen
)
target_link_libraries(component
PUBLIC dom
)
2023-02-12 21:09:47 +08:00
if (NOT EMSCRIPTEN)
find_package(Threads)
target_link_libraries(component
PUBLIC Threads::Threads
)
endif()
include(cmake/ftxui_set_options.cmake)
ftxui_set_options(screen)
ftxui_set_options(dom)
ftxui_set_options(component)
2022-04-17 21:47:20 +08:00
include(cmake/ftxui_coverage.cmake)
ftxui_check_coverage(screen)
ftxui_check_coverage(dom)
ftxui_check_coverage(component)
include(cmake/ftxui_test.cmake)
include(cmake/ftxui_benchmark.cmake)
include(cmake/ftxui_fuzzer.cmake)
include(cmake/iwyu.cmake)
include(cmake/ftxui_export.cmake)
include(cmake/ftxui_install.cmake)
include(cmake/ftxui_package.cmake)
2021-10-01 03:13:16 +08:00
2024-06-26 00:36:25 +08:00
# --- Find OpenCV and add as a dependency ---
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(screen
PUBLIC ${OpenCV_LIBS}
)
target_link_libraries(dom
PUBLIC ${OpenCV_LIBS}
)
target_link_libraries(component
PUBLIC ${OpenCV_LIBS}
)
add_subdirectory(examples)
add_subdirectory(doc)
2024-06-26 00:36:25 +08:00