Update CMake search for Qt5 componets to be consistent with recommended practice from Kitware. (see https://blog.kitware.com/cmake-finding-qt5-the-right-way/) Incorporate ability to build cppcheck-gui with Qt Charts via CMake switch. Option "WITH_QCHARTS" will enable search for Qt Charts to Qt5 component search and add build flag "HAVE_QCHART".
26 lines
755 B
CMake
26 lines
755 B
CMake
if (BUILD_GUI)
|
|
if (NOT WITH_QCHART)
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport LinguistTools REQUIRED)
|
|
else()
|
|
find_package(Qt5 COMPONENTS Core Gui Widgets PrintSupport LinguistTools Charts REQUIRED)
|
|
endif()
|
|
endif()
|
|
|
|
if (HAVE_RULES)
|
|
find_library(PCRE pcre)
|
|
if (NOT PCRE)
|
|
message(FATAL_ERROR "pcre dependency for RULES has not been found")
|
|
endif()
|
|
endif()
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
set(CMAKE_AUTOMOC OFF)
|
|
|
|
if (NOT ${USE_MATCHCOMPILER_OPT} STREQUAL "Off")
|
|
find_package(PythonInterp)
|
|
if (NOT ${PYTHONINTERP_FOUND})
|
|
message(WARNING "No python interpreter found. Therefore, the match compiler is switched off.")
|
|
set(USE_MATCHCOMPILER_OPT "Off")
|
|
endif()
|
|
endif()
|