From 20c4501d89a363ba7a695ed2a68b372e352d2818 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Jun 02 2018 13:34:26 +0000 Subject: Patch out obsoleted CMake syntax. --- diff --git a/cppcheck-1.83-cmake.patch b/cppcheck-1.83-cmake.patch new file mode 100644 index 0000000..7bed3ff --- /dev/null +++ b/cppcheck-1.83-cmake.patch @@ -0,0 +1,24 @@ +diff -up cppcheck-1.83/CMakeLists.txt.qt5cmake cppcheck-1.83/CMakeLists.txt +--- cppcheck-1.83/CMakeLists.txt.qt5cmake 2018-06-02 14:01:44.339998373 +0200 ++++ cppcheck-1.83/CMakeLists.txt 2018-06-02 14:01:44.370997858 +0200 +@@ -1,5 +1,5 @@ + project(CppCheck) +-cmake_minimum_required(VERSION 2.8.4) ++cmake_minimum_required(VERSION 2.8.11) + + include(GNUInstallDirs) + +diff -up cppcheck-1.83/gui/CMakeLists.txt.qt5cmake cppcheck-1.83/gui/CMakeLists.txt +--- cppcheck-1.83/gui/CMakeLists.txt.qt5cmake 2018-06-02 14:01:44.372997824 +0200 ++++ cppcheck-1.83/gui/CMakeLists.txt 2018-06-02 14:02:04.869656720 +0200 +@@ -24,8 +24,8 @@ if (BUILD_GUI) + target_link_libraries(cppcheck-gui pcre) + endif() + target_link_libraries(cppcheck-gui tinyxml2) +- qt5_use_modules(cppcheck-gui ${GUI_QT_COMPONENTS}) +- ++ target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::LinguistTools) ++ + install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications) + install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications) + diff --git a/cppcheck.spec b/cppcheck.spec index b94b300..12d57b7 100644 --- a/cppcheck.spec +++ b/cppcheck.spec @@ -18,6 +18,8 @@ Patch0: cppcheck-1.83-tinyxml.patch Patch1: cppcheck-1.81-translations.patch # Set location of config files Patch2: cppcheck-1.78-cfgdir.patch +# Use modern qt5 cmake +Patch3: cppcheck-1.83-cmake.patch BuildRequires: gcc-c++ BuildRequires: pcre-devel @@ -68,6 +70,7 @@ from xml files first generated using cppcheck. %patch0 -p1 -b .tinyxml %patch1 -p1 -b .translations %patch2 -p1 -b .cfgdir +%patch3 -p1 -b .qt5cmake # Make sure bundled tinyxml is not used rm -r externals/tinyxml