cppcheck/tools/triage/CMakeLists.txt
Oliver Stöneberg 54d621555d
scan GUI sources with clang-tidy in CI (#3233)
* build UI dependencies before running clang-tidy

* clang-tidy.yml: enabled GUI sources and build some dependencies for clang-tidy

* work around missing dependency for Qt install step
2021-10-31 20:15:32 +01:00

33 lines
1.1 KiB
CMake

if (BUILD_GUI AND BUILD_TESTS)
if (CMAKE_BUILD_TYPE MATCHES "Release")
add_definitions(-DQT_NO_DEBUG)
add_definitions(-DQT_NO_DEBUG_OUTPUT)
add_definitions(-DQT_NO_WARNING_OUTPUT)
else()
add_definitions(-DQT_DEBUG)
endif()
file(GLOB hdrs "*.h")
file(GLOB srcs "*.cpp")
file(GLOB uis "*.ui")
qt5_wrap_ui(uis_hdrs ${uis})
add_custom_target(triage-build-ui-deps SOURCES ${hdrs} ${uis_hdrs})
add_executable(
triage
${hdrs}
${srcs}
${uis_hdrs}
${PROJECT_SOURCE_DIR}/gui/codeeditorstyle.cpp
${PROJECT_SOURCE_DIR}/gui/codeeditor.cpp)
set_target_properties(triage PROPERTIES AUTOMOC ON)
target_include_directories(triage PRIVATE ${PROJECT_SOURCE_DIR}/lib/ ${PROJECT_SOURCE_DIR}/gui/)
target_link_libraries(triage Qt5::Core Qt5::Gui Qt5::Widgets)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
# Q_UNUSED() in generated code
target_compile_options(triage PRIVATE -Wno-extra-semi-stmt)
endif()
endif()
endif()