From d9b300ccf63acdf27d11accf588f15ed6814ae65 Mon Sep 17 00:00:00 2001 From: firewave Date: Thu, 18 Sep 2025 12:50:07 +0200 Subject: [PATCH 1/3] replaced deprecated `qt_wrap_ui()` with `AUTOUIC` property --- gui/CMakeLists.txt | 6 ++++-- tools/triage/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index d640c341458..c0ac456e5b1 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -13,11 +13,10 @@ CheckOptions: file(GLOB srcs "*.cpp") file(GLOB uis "*.ui") file(GLOB tss "*.ts") - QT_WRAP_UI(uis_hdrs ${uis}) QT_ADD_RESOURCES(resources "gui.qrc") # TODO: passing "-no-obsolete" here breaks the translations QT_CREATE_TRANSLATION(qms ${CMAKE_CURRENT_SOURCE_DIR} ${tss}) - list(APPEND cppcheck-gui-deps ${hdrs} ${uis_hdrs} ${resources} ${qms}) + list(APPEND cppcheck-gui-deps ${hdrs} ${uis} ${resources} ${qms}) add_custom_target(gui-build-deps SOURCES ${cppcheck-gui-deps}) list(APPEND cppcheck-gui_SOURCES ${srcs}) @@ -26,9 +25,12 @@ CheckOptions: endif() add_executable(cppcheck-gui ${cppcheck-gui-deps} ${cppcheck-gui_SOURCES}) + # the GUI include is needed so the includes are found from the generated headers - TODO: is it possible to get rid of this? + target_include_directories(cppcheck-gui PRIVATE ${PROJECT_SOURCE_DIR}/gui/) target_link_libraries(cppcheck-gui cppcheck-core simplecpp tinyxml2 picojson frontend) set_target_properties(cppcheck-gui PROPERTIES AUTOMOC ON) + set_target_properties(cppcheck-gui PROPERTIES AUTOUIC ON) set_target_properties(cppcheck-gui PROPERTIES WIN32_EXECUTABLE ON) if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) target_precompile_headers(cppcheck-gui PRIVATE precompiled.h) diff --git a/tools/triage/CMakeLists.txt b/tools/triage/CMakeLists.txt index d0f9fce1599..0d5f5d8930b 100644 --- a/tools/triage/CMakeLists.txt +++ b/tools/triage/CMakeLists.txt @@ -11,9 +11,8 @@ CheckOptions: file(GLOB hdrs "*.h") file(GLOB srcs "*.cpp") file(GLOB uis "*.ui") - qt_wrap_ui(uis_hdrs ${uis}) - add_custom_target(triage-build-ui-deps SOURCES ${hdrs} ${uis_hdrs}) + add_custom_target(triage-build-ui-deps SOURCES ${hdrs} ${uis}) add_executable( triage ${hdrs} @@ -22,6 +21,7 @@ CheckOptions: ${PROJECT_SOURCE_DIR}/gui/codeeditorstyle.cpp ${PROJECT_SOURCE_DIR}/gui/codeeditor.cpp) set_target_properties(triage PROPERTIES AUTOMOC ON) + set_target_properties(triage PROPERTIES AUTOUIC ON) set_target_properties(triage PROPERTIES WIN32_EXECUTABLE ON) target_include_directories(triage PRIVATE ${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/gui/) target_link_libraries(triage ${QT_CORE_LIB} ${QT_GUI_LIB} ${QT_WIDGETS_LIB}) From 697708349da7b48a3da7b577fc0463f9c392c7fc Mon Sep 17 00:00:00 2001 From: firewave Date: Tue, 23 Sep 2025 14:22:11 +0200 Subject: [PATCH 2/3] findDependencies.cmake: removed unnecessary setting of `CMAKE_INCLUDE_CURRENT_DIR` [skip ci] --- cmake/findDependencies.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index b1f6571504d..a185eb02bfb 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -38,8 +38,6 @@ else() set(PCRE_LIBRARY "") endif() -set(CMAKE_INCLUDE_CURRENT_DIR ON) - find_package(Python COMPONENTS Interpreter) if(NOT Python_Interpreter_FOUND) From 78e2c4a225b1f48de9b471ddb059feba83a0e0c2 Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 4 May 2026 09:46:58 +0200 Subject: [PATCH 3/3] qt_add_ui [skip ci] --- gui/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index c0ac456e5b1..089684b6ee3 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -25,12 +25,13 @@ CheckOptions: endif() add_executable(cppcheck-gui ${cppcheck-gui-deps} ${cppcheck-gui_SOURCES}) + qt_add_ui(cppcheck-gui SOURCES ${uis}) # the GUI include is needed so the includes are found from the generated headers - TODO: is it possible to get rid of this? target_include_directories(cppcheck-gui PRIVATE ${PROJECT_SOURCE_DIR}/gui/) target_link_libraries(cppcheck-gui cppcheck-core simplecpp tinyxml2 picojson frontend) set_target_properties(cppcheck-gui PROPERTIES AUTOMOC ON) - set_target_properties(cppcheck-gui PROPERTIES AUTOUIC ON) + #set_target_properties(cppcheck-gui PROPERTIES AUTOUIC ON) set_target_properties(cppcheck-gui PROPERTIES WIN32_EXECUTABLE ON) if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) target_precompile_headers(cppcheck-gui PRIVATE precompiled.h)