2019-06-01 10:48:39 +02:00
|
|
|
if (BUILD_GUI AND BUILD_TESTS)
|
2022-09-30 07:27:03 +02:00
|
|
|
# disable all clang-tidy checks for Qt generated files
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/.clang-tidy"
|
|
|
|
"---
|
|
|
|
Checks: '-*,misc-definitions-in-headers'
|
|
|
|
WarningsAsErrors: '*'
|
|
|
|
CheckOptions:
|
|
|
|
- { key: HeaderFileExtensions, value: 'x' }
|
|
|
|
")
|
|
|
|
|
2023-06-26 11:15:41 +02:00
|
|
|
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
|
|
|
|
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG_OUTPUT>)
|
|
|
|
add_compile_definitions($<$<NOT:$<CONFIG:Debug>>:QT_NO_WARNING_OUTPUT>)
|
|
|
|
add_compile_definitions($<$<CONFIG:Debug>:QT_DEBUG>)
|
2019-06-01 10:48:39 +02:00
|
|
|
|
|
|
|
file(GLOB hdrs "*.h")
|
|
|
|
file(GLOB srcs "*.cpp")
|
|
|
|
file(GLOB uis "*.ui")
|
2022-02-07 17:35:25 +01:00
|
|
|
qt_wrap_ui(uis_hdrs ${uis})
|
2019-06-01 10:48:39 +02:00
|
|
|
|
2021-10-31 20:15:32 +01:00
|
|
|
add_custom_target(triage-build-ui-deps SOURCES ${hdrs} ${uis_hdrs})
|
2019-06-23 19:04:53 +02:00
|
|
|
add_executable(
|
|
|
|
triage
|
|
|
|
${hdrs}
|
|
|
|
${srcs}
|
|
|
|
${uis_hdrs}
|
|
|
|
${PROJECT_SOURCE_DIR}/gui/codeeditorstyle.cpp
|
|
|
|
${PROJECT_SOURCE_DIR}/gui/codeeditor.cpp)
|
2021-10-30 09:08:07 +02:00
|
|
|
set_target_properties(triage PROPERTIES AUTOMOC ON)
|
2023-11-15 16:56:46 +01:00
|
|
|
set_target_properties(cppcheck-gui PROPERTIES WIN32_EXECUTABLE ON)
|
2021-10-30 09:08:07 +02:00
|
|
|
target_include_directories(triage PRIVATE ${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/gui/)
|
2022-02-07 17:35:25 +01:00
|
|
|
target_link_libraries(triage ${QT_CORE_LIB} ${QT_GUI_LIB} ${QT_WIDGETS_LIB})
|
2020-04-21 17:27:51 +02:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2022-03-13 20:07:58 +01:00
|
|
|
# Q_UNUSED() in generated code
|
|
|
|
target_compile_options_safe(triage -Wno-extra-semi-stmt)
|
|
|
|
# caused by Qt generated moc code
|
|
|
|
target_compile_options_safe(triage -Wno-redundant-parens)
|
2020-04-21 17:27:51 +02:00
|
|
|
endif()
|
2019-06-01 10:48:39 +02:00
|
|
|
endif()
|