diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e1ee56..e5b366b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ current (development) ### Build - Check version compatibility when using cmake find_package() +- Add `FTXUI_DEV_WARNING` options to turn on warnings when building FTXUI +- Turn OFF by default `FTXUI_BUILD_DOCS` +- Turn OFF by default `FTXUI_BUILD_EXAMPLE` 4.1.1 ----- diff --git a/CMakeLists.txt b/CMakeLists.txt index 65dc001..c99700f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,9 @@ project(ftxui DESCRIPTION "C++ Functional Terminal User Interface." ) -option(FTXUI_BUILD_DOCS "Set to ON to build docs" ON) -option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" ON) +option(FTXUI_QUIET "Set to ON for FTXUI to be quiet" OFF) +option(FTXUI_BUILD_EXAMPLES "Set to ON to build examples" OFF) +option(FTXUI_BUILD_DOCS "Set to ON to build docs" OFF) 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) @@ -26,6 +27,7 @@ else() ${FTXUI_MICROSOFT_TERMINAL_FALLBACK_HELP_TEXT} OFF) endif() +include(cmake/ftxui_message.cmake) add_library(screen include/ftxui/screen/box.hpp diff --git a/cmake/ftxui_message.cmake b/cmake/ftxui_message.cmake new file mode 100644 index 0000000..49cc4e8 --- /dev/null +++ b/cmake/ftxui_message.cmake @@ -0,0 +1,17 @@ +function(ftxui_message msg) + if (NOT FTXUI_QUIET) + message(STATUS "${msg}") + endif() +endfunction() + +ftxui_message("┌─ FTXUI options ─────────────────────") +ftxui_message("│ FTXUI_ENABLE_INSTALL : ${FTXUI_ENABLE_INSTALL}") +ftxui_message("│ FTXUI_BUILD_EXAMPLES : ${FTXUI_BUILD_EXAMPLES}") +ftxui_message("│ FTXUI_QUIET : ${FTXUI_QUIET}") +ftxui_message("│ FTXUI_BUILD_DOCS : ${FTXUI_BUILD_DOCS}") +ftxui_message("│ FTXUI_BUILD_TESTS : ${FTXUI_BUILD_TESTS}") +ftxui_message("│ FTXUI_BUILD_TESTS_FUZZER : ${FTXUI_BUILD_TESTS_FUZZER}") +ftxui_message("│ FTXUI_ENABLE_COVERAGE : ${FTXUI_ENABLE_COVERAGE}") +ftxui_message("│ FTXUI_DEV_WARNINGS : ${FTXUI_DEV_WARNINGS}") +ftxui_message("│ FTXUI_CLANG_TIDY : ${FTXUI_CLANG_TIDY}") +ftxui_message("└─────────────────────────────────────") diff --git a/cmake/ftxui_set_options.cmake b/cmake/ftxui_set_options.cmake index 40a88e1..a269286 100644 --- a/cmake/ftxui_set_options.cmake +++ b/cmake/ftxui_set_options.cmake @@ -1,18 +1,16 @@ find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable" ) -if(NOT CLANG_TIDY_EXE) - message(STATUS "clang-tidy not found.") -else() - message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") -endif() function(ftxui_set_options library) - message(STATUS "ftxui_set_options " ${library}) set_target_properties(${library} PROPERTIES VERSION ${PROJECT_VERSION}) if (NOT ${library} MATCHES "ftxui-*") set_target_properties(${library} PROPERTIES OUTPUT_NAME "ftxui-${library}") endif() - if(CLANG_TIDY_EXE AND FTXUI_CLANG_TIDY) + if (FTXUI_CLANG_TIDY) + if (NOT CLANG_TIDY_EXE) + message(FATAL_ERROR "clang-tidy requested but executable not found") + endif() + set_target_properties(${library} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-warnings-as-errors=*" )