2015-02-13 19:00:14 +01:00
|
|
|
if (BUILD_GUI)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2020-04-22 11:04:19 +02:00
|
|
|
if (CMAKE_BUILD_TYPE MATCHES "Release")
|
2015-02-13 19:00:14 +01:00
|
|
|
add_definitions(-DQT_NO_DEBUG)
|
|
|
|
add_definitions(-DQT_NO_DEBUG_OUTPUT)
|
|
|
|
add_definitions(-DQT_NO_WARNING_OUTPUT)
|
|
|
|
else()
|
|
|
|
add_definitions(-DQT_DEBUG)
|
|
|
|
endif()
|
2016-09-27 07:36:08 +02:00
|
|
|
|
2015-02-13 19:00:14 +01:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/lib/)
|
2020-11-16 09:11:08 +01:00
|
|
|
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/externals/tinyxml2/)
|
2015-02-13 19:00:14 +01:00
|
|
|
|
|
|
|
file(GLOB hdrs "*.h")
|
|
|
|
file(GLOB srcs "*.cpp")
|
|
|
|
file(GLOB uis "*.ui")
|
|
|
|
file(GLOB tss "*.ts")
|
2017-08-07 23:49:47 +02:00
|
|
|
QT5_WRAP_UI(uis_hdrs ${uis})
|
|
|
|
QT5_ADD_RESOURCES(resources "gui.qrc")
|
|
|
|
QT5_ADD_TRANSLATION(qms ${tss})
|
2016-09-27 07:36:08 +02:00
|
|
|
|
2020-11-16 09:11:08 +01:00
|
|
|
add_executable(cppcheck-gui ${hdrs} ${srcs} ${uis_hdrs} ${resources} ${qms} $<TARGET_OBJECTS:lib_objs> $<TARGET_OBJECTS:tinyxml2_objs> $<TARGET_OBJECTS:simplecpp_objs>)
|
2015-11-26 20:25:09 +01:00
|
|
|
if (HAVE_RULES)
|
2020-05-27 05:15:46 +02:00
|
|
|
target_link_libraries(cppcheck-gui ${PCRE_LIBRARY})
|
|
|
|
endif()
|
|
|
|
if (USE_Z3)
|
|
|
|
target_link_libraries(cppcheck-gui ${Z3_LIBRARIES})
|
2015-11-26 20:25:09 +01:00
|
|
|
endif()
|
2020-07-26 00:22:28 +02:00
|
|
|
target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Help)
|
2019-05-17 10:17:51 +02:00
|
|
|
if(WITH_QCHART)
|
|
|
|
target_compile_definitions (cppcheck-gui PRIVATE HAVE_QCHART )
|
|
|
|
target_link_libraries(cppcheck-gui Qt5::Charts)
|
|
|
|
endif()
|
2020-04-21 17:27:51 +02:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2020-04-22 11:04:19 +02:00
|
|
|
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
|
|
|
# Q_UNUSED() in generated code
|
|
|
|
target_compile_options(cppcheck-gui PRIVATE -Wno-extra-semi-stmt)
|
|
|
|
endif()
|
2020-04-21 17:27:51 +02:00
|
|
|
endif()
|
2015-02-13 19:00:14 +01:00
|
|
|
|
2015-11-26 20:25:09 +01:00
|
|
|
install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
|
|
|
|
install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
|
2015-02-13 19:00:14 +01:00
|
|
|
|
2016-09-27 07:36:08 +02:00
|
|
|
install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
|
|
|
|
|
|
|
# icons
|
2016-09-27 10:13:24 +02:00
|
|
|
install(FILES cppcheck-gui.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
|
2016-09-27 10:10:09 +02:00
|
|
|
install(FILES cppcheck-gui.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/64x64/apps)
|
2016-09-27 07:36:08 +02:00
|
|
|
|
2015-02-13 19:00:14 +01:00
|
|
|
set(CMAKE_AUTOMOC OFF)
|
|
|
|
|
|
|
|
endif()
|