2018-09-18 14:48:40 +08:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
|
2019-01-07 01:53:02 +08:00
|
|
|
add_library(screen
|
2019-01-20 05:06:05 +08:00
|
|
|
src/ftxui/screen/box.cpp
|
2019-01-07 01:53:02 +08:00
|
|
|
src/ftxui/screen/screen.cpp
|
2019-01-12 22:00:08 +08:00
|
|
|
src/ftxui/screen/string.cpp
|
2019-01-20 05:06:05 +08:00
|
|
|
src/ftxui/screen/terminal.cpp
|
2019-01-07 01:53:02 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(dom
|
2018-10-21 20:18:11 +08:00
|
|
|
src/ftxui/dom/blink.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/bold.cpp
|
2019-01-20 05:06:05 +08:00
|
|
|
src/ftxui/dom/border.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
|
2019-01-03 07:35:59 +08:00
|
|
|
src/ftxui/dom/dbox.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
|
2019-01-27 04:52:55 +08:00
|
|
|
src/ftxui/dom/graph.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/hbox.cpp
|
2019-01-23 06:42:57 +08:00
|
|
|
src/ftxui/dom/hflow.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
|
2019-01-23 07:26:36 +08:00
|
|
|
src/ftxui/dom/paragraph.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/separator.cpp
|
2019-01-07 02:17:27 +08:00
|
|
|
src/ftxui/dom/size.cpp
|
2019-01-07 05:28:15 +08:00
|
|
|
src/ftxui/dom/spinner.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/text.cpp
|
2018-10-12 15:23:37 +08:00
|
|
|
src/ftxui/dom/underlined.cpp
|
2018-10-21 20:18:11 +08:00
|
|
|
src/ftxui/dom/util.cpp
|
2018-10-10 01:06:03 +08:00
|
|
|
src/ftxui/dom/vbox.cpp
|
2018-09-18 14:48:40 +08:00
|
|
|
)
|
|
|
|
|
2019-01-07 01:53:02 +08:00
|
|
|
add_library(component
|
2019-01-13 05:25:49 +08:00
|
|
|
src/ftxui/component/checkbox.cpp
|
2019-01-07 01:53:02 +08:00
|
|
|
src/ftxui/component/component.cpp
|
2019-01-13 01:24:46 +08:00
|
|
|
src/ftxui/component/container.cpp
|
2019-01-07 01:53:02 +08:00
|
|
|
src/ftxui/component/event.cpp
|
|
|
|
src/ftxui/component/input.cpp
|
|
|
|
src/ftxui/component/menu.cpp
|
2019-01-19 05:41:33 +08:00
|
|
|
src/ftxui/component/radiobox.cpp
|
2019-01-07 01:53:02 +08:00
|
|
|
src/ftxui/component/screen_interactive.cpp
|
|
|
|
src/ftxui/component/toggle.cpp
|
|
|
|
)
|
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
target_link_libraries(dom PUBLIC screen)
|
|
|
|
target_link_libraries(component PUBLIC dom)
|
2018-09-18 14:48:40 +08:00
|
|
|
|
2019-01-07 01:53:02 +08:00
|
|
|
|
2019-01-12 22:00:08 +08:00
|
|
|
foreach(lib screen dom component)
|
|
|
|
target_include_directories(${lib}
|
|
|
|
PUBLIC
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
PRIVATE src
|
|
|
|
)
|
|
|
|
target_compile_features(${lib} PUBLIC cxx_std_17)
|
|
|
|
target_compile_options(${lib} PRIVATE -Wall)
|
|
|
|
endforeach()
|
2019-01-07 01:53:02 +08:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
install(TARGETS screen dom component
|
|
|
|
EXPORT ftxui-export
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ftxui/
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/ftxui/
|
|
|
|
)
|
|
|
|
|
|
|
|
install(DIRECTORY include/ftxui DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
|
|
|
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
write_basic_package_version_file(
|
|
|
|
ftxui-config.cmake
|
|
|
|
VERSION ${PACKAGE_VERSION}
|
|
|
|
COMPATIBILITY AnyNewerVersion
|
|
|
|
)
|
|
|
|
|
|
|
|
install(EXPORT ftxui-export
|
|
|
|
FILE ftxui-targets.cmake
|
|
|
|
NAMESPACE ftxui::
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
|
|
|
)
|
2018-09-18 14:48:40 +08:00
|
|
|
|
|
|
|
# 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)
|
2019-01-07 01:53:02 +08:00
|
|
|
add_executable(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
|
|
|
)
|
2019-01-07 01:53:02 +08:00
|
|
|
|
|
|
|
target_link_libraries(dom_tests
|
|
|
|
PRIVATE dom
|
|
|
|
PRIVATE Threads::Threads
|
|
|
|
PRIVATE ${GTEST_BOTH_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(dom_tests
|
|
|
|
PRIVATE ${GTest_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
gtest_discover_tests(dom_tests)
|
|
|
|
add_test(dom_tests dom_tests)
|
|
|
|
|
2018-09-18 14:48:40 +08:00
|
|
|
endif()
|