From 45d6794cc7ef46e35992735e5ef337e8d077e049 Mon Sep 17 00:00:00 2001 From: Diogo Benvenutti Date: Sun, 25 Aug 2024 13:32:04 +0200 Subject: [PATCH] Set cxx extensions and std required flags per target --- CMakeLists.txt | 3 --- app-qtwidget/CMakeLists.txt | 8 +++++++- model/CMakeLists.txt | 8 +++++++- model/tests/CMakeLists.txt | 8 +++++++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4168fe5..8e0cb6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,6 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release FORCE) endif() -set(CXX_STANDARD_REQUIRED ON) -set(CXX_EXTENSIONS OFF) - # testing: if(BUILD_TESTS) diff --git a/app-qtwidget/CMakeLists.txt b/app-qtwidget/CMakeLists.txt index 75847a0..98dfd46 100644 --- a/app-qtwidget/CMakeLists.txt +++ b/app-qtwidget/CMakeLists.txt @@ -14,7 +14,13 @@ qt_add_executable( target_compile_features(core8-gui-qtwidget PUBLIC cxx_std_20) -set_target_properties(core8-gui-qtwidget PROPERTIES COMPILE_WARNING_AS_ERROR ON) +set_target_properties( + core8-gui-qtwidget + PROPERTIES + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + COMPILE_WARNING_AS_ERROR ON +) target_link_libraries( core8-gui-qtwidget diff --git a/model/CMakeLists.txt b/model/CMakeLists.txt index 0c75c8c..7011ee9 100644 --- a/model/CMakeLists.txt +++ b/model/CMakeLists.txt @@ -16,7 +16,13 @@ add_library( target_compile_features(core8-model PUBLIC cxx_std_20) -set_target_properties(core8-model PROPERTIES COMPILE_WARNING_AS_ERROR ON) +set_target_properties( + core8-model + PROPERTIES + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + COMPILE_WARNING_AS_ERROR ON +) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/model/Version.hpp.in diff --git a/model/tests/CMakeLists.txt b/model/tests/CMakeLists.txt index a8121b6..46c7b7d 100644 --- a/model/tests/CMakeLists.txt +++ b/model/tests/CMakeLists.txt @@ -22,7 +22,13 @@ add_executable( target_compile_features(model_tests PUBLIC cxx_std_20) -set_target_properties(model_tests PROPERTIES COMPILE_WARNING_AS_ERROR ON) +set_target_properties( + model_tests + PROPERTIES + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + COMPILE_WARNING_AS_ERROR ON +) target_link_libraries(model_tests PRIVATE core8-model Catch2::Catch2WithMain)