diff --git a/cmake/ftxui_set_options.cmake b/cmake/ftxui_set_options.cmake index 7017639e0dc795106249ec19cf3d03d1d85a368b..1cefd5c3a97bbf3319680a66feaff01d9b6c8814 100644 --- a/cmake/ftxui_set_options.cmake +++ b/cmake/ftxui_set_options.cmake @@ -13,14 +13,31 @@ function(ftxui_set_options library) set_target_properties(${library} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-warnings-as-errors=*" ) + + # By using "PUBLIC" as opposed to "SYSTEM INTERFACE", the compiler warning + # are enforced on the headers. This is behind "FTXUI_CLANG_TIDY", so that it + # applies only when developing FTXUI and on the CI. User's of the library + # get only the SYSTEM INTERFACE instead. + target_include_directories(${library} + PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + ) + else() + target_include_directories(${library} SYSTEM + INTERFACE + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + ) endif() - target_include_directories(${library} - PUBLIC + target_include_directories(${library} SYSTEM + INTERFACE $<INSTALL_INTERFACE:include> - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + ) + + target_include_directories(${library} PRIVATE - src + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ) # C++17 is used. We require fold expression at least.