2018-09-18 14:48:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(ftxui)
|
|
|
|
|
|
|
|
add_library(ftxui
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/component/component.cpp
|
|
|
|
src/ftxui/component/component_direction.cpp
|
|
|
|
src/ftxui/component/component_horizontal.cpp
|
|
|
|
src/ftxui/component/component_vertical.cpp
|
2018-10-19 04:58:38 +08:00
|
|
|
src/ftxui/component/input.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/component/menu.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/component/toggle.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/bold.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/color.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/composite_decorator.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/dim.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/flex.cpp
|
|
|
|
src/ftxui/dom/frame.cpp
|
|
|
|
src/ftxui/dom/gauge.cpp
|
|
|
|
src/ftxui/dom/hbox.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/inverted.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/node.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/node_decorator.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/separator.cpp
|
|
|
|
src/ftxui/dom/text.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/underlined.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/vbox.cpp
|
2018-10-19 04:58:38 +08:00
|
|
|
src/ftxui/event.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/screen.cpp
|
|
|
|
src/ftxui/screen_interactive.cpp
|
|
|
|
src/ftxui/terminal.cpp
|
2018-09-18 14:48:40 +08:00
|
|
|
src/ftxui/util/string.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(ftxui
|
|
|
|
PUBLIC include
|
|
|
|
PRIVATE src
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_features(ftxui PUBLIC cxx_std_17)
|
|
|
|
target_compile_options(ftxui PRIVATE -Wall)
|
|
|
|
|
|
|
|
# Note: For gtest, please follow:
|
|
|
|
# https://stackoverflow.com/questions/24295876/cmake-cannot-find-a-googletest-required-library
|
|
|
|
find_package(GTest)
|
|
|
|
find_package(Threads)
|
|
|
|
if (GTEST_FOUND AND THREADS_FOUND)
|
|
|
|
function(add_new_test test_name test_files)
|
|
|
|
add_executable(${ARGV})
|
|
|
|
target_link_libraries(${test_name}
|
|
|
|
PRIVATE
|
|
|
|
ftxui
|
|
|
|
Threads::Threads
|
|
|
|
${GTEST_BOTH_LIBRARIES}
|
|
|
|
)
|
|
|
|
target_include_directories(ftxui
|
|
|
|
PRIVATE
|
|
|
|
${GTest_INCLUDE_DIRS}
|
|
|
|
ftxui
|
|
|
|
)
|
|
|
|
gtest_discover_tests(${test_name})
|
|
|
|
add_test(${test_name} ${test_name})
|
|
|
|
endfunction(add_new_test)
|
|
|
|
|
|
|
|
add_new_test(dom_tests
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/gauge_test.cpp
|
|
|
|
src/ftxui/dom/hbox_test.cpp
|
|
|
|
src/ftxui/dom/text_test.cpp
|
|
|
|
src/ftxui/dom/vbox_test.cpp
|
2018-09-18 14:48:40 +08:00
|
|
|
)
|
|
|
|
endif()
|