11option (ENABLE_CPPCHECK "Enable static analysis with cppcheck" OFF )
22option (ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF )
33option (ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF )
4+ set (ENABLE_QT_DEPRECATION_CHECK "" CACHE STRING "Define hex value (e.g. 0x061100 for Qt 6.11) for testing for deprecations. Empty = OFF" )
45
56if (ENABLE_CPPCHECK)
67 find_program (CPPCHECK cppcheck )
78 if (CPPCHECK)
9+ message (STATUS "CPPCHECK is enabled!" )
810 set (CMAKE_CXX_CPPCHECK
911 ${CPPCHECK}
12+ --library=qt
1013 --suppress=missingInclude
1114 --enable=all
1215 --inline-suppr
13- --inconclusive
14- -i
15- ${CMAKE_SOURCE_DIR} /imgui/lib)
16+ --inconclusive)
1617 else ()
1718 message (SEND_ERROR "cppcheck requested but executable not found" )
1819 endif ()
@@ -21,6 +22,7 @@ endif()
2122if (ENABLE_CLANG_TIDY)
2223 find_program (CLANGTIDY clang-tidy )
2324 if (CLANGTIDY)
25+ message (STATUS "CLANGTIDY is enabled!" )
2426 set (CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option)
2527 else ()
2628 message (SEND_ERROR "clang-tidy requested but executable not found" )
@@ -30,8 +32,14 @@ endif()
3032if (ENABLE_INCLUDE_WHAT_YOU_USE)
3133 find_program (INCLUDE_WHAT_YOU_USE include -what-you-use )
3234 if (INCLUDE_WHAT_YOU_USE)
35+ message (STATUS "INCLUDE_WHAT_YOU_USE is enabled!" )
3336 set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE} )
3437 else ()
3538 message (SEND_ERROR "include-what-you-use requested but executable not found" )
3639 endif ()
3740endif ()
41+
42+ if (NOT "${ENABLE_QT_DEPRECATION_CHECK} " STREQUAL "" )
43+ message (STATUS "Qt deprecations warnings enabled for: ${ENABLE_QT_DEPRECATION_CHECK} " )
44+ add_compile_definitions (QT_DISABLE_DEPRECATED_BEFORE=${ENABLE_QT_DEPRECATION_CHECK} )
45+ endif ()
0 commit comments