Simplify cppcheck-2.7.3-tinyxml2.patch

This commit is contained in:
Wolfgang Stöggl 2022-03-19 17:20:53 +01:00
parent 9e60ef3b47
commit ef547dcd11
1 changed files with 13 additions and 86 deletions

View File

@ -1,88 +1,15 @@
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index 629354086..7ec2288fe 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -35,7 +35,7 @@ if (WIN32 AND NOT BORLAND)
endif()
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(cppcheck ${tinyxml2_LIBRARIES})
+ target_link_libraries(cppcheck tinyxml2)
endif()
diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake
index 4d5b9efc5..6f6d9210c 100644
--- a/cmake/findDependencies.cmake
+++ b/cmake/findDependencies.cmake
@@ -48,7 +48,9 @@ endif()
add_dependencies(cppcheck copy_cfg)
diff --git a/cmake/printInfo.cmake b/cmake/printInfo.cmake
index 2fd971b1d..8bf497304 100644
--- a/cmake/printInfo.cmake
+++ b/cmake/printInfo.cmake
@@ -54,7 +54,7 @@ if (USE_Z3)
endif()
message( STATUS "USE_BUNDLED_TINYXML2 = ${USE_BUNDLED_TINYXML2}" )
if (NOT USE_BUNDLED_TINYXML2)
- message(STATUS "tinyxml2_LIBRARIES = ${tinyxml2_LIBRARIES}")
+ message(STATUS "tinyxml2_LIBRARIES = tinyxml2")
endif()
message( STATUS )
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 4f265f7fc..213ad5918 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -36,7 +36,7 @@ if (BUILD_GUI)
target_link_libraries(cppcheck-gui ${Z3_LIBRARIES})
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(cppcheck-gui ${tinyxml2_LIBRARIES})
+ target_link_libraries(cppcheck-gui tinyxml2)
endif()
target_link_libraries(cppcheck-gui Qt5::Core Qt5::Gui Qt5::Widgets Qt5::PrintSupport Qt5::Help)
if(WITH_QCHART)
diff --git a/gui/test/benchmark/simple/CMakeLists.txt b/gui/test/benchmark/simple/CMakeLists.txt
index c6c6cd672..81351e719 100644
--- a/gui/test/benchmark/simple/CMakeLists.txt
+++ b/gui/test/benchmark/simple/CMakeLists.txt
@@ -20,5 +20,5 @@ if (USE_Z3)
target_link_libraries(benchmark-simple ${Z3_LIBRARIES})
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(benchmark-simple ${tinyxml2_LIBRARIES})
+ target_link_libraries(benchmark-simple tinyxml2)
endif()
\ No newline at end of file
diff --git a/gui/test/xmlreportv2/CMakeLists.txt b/gui/test/xmlreportv2/CMakeLists.txt
index 97932d8e8..5dd39465c 100644
--- a/gui/test/xmlreportv2/CMakeLists.txt
+++ b/gui/test/xmlreportv2/CMakeLists.txt
@@ -24,5 +24,5 @@ if (USE_Z3)
target_link_libraries(test-xmlreportv2 ${Z3_LIBRARIES})
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(test-xmlreportv2 ${tinyxml2_LIBRARIES})
+ target_link_libraries(test-xmlreportv2 tinyxml2)
endif()
diff --git a/oss-fuzz/CMakeLists.txt b/oss-fuzz/CMakeLists.txt
index e3117b05a..5b2c5e059 100644
--- a/oss-fuzz/CMakeLists.txt
+++ b/oss-fuzz/CMakeLists.txt
@@ -25,7 +25,7 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_link_libraries(fuzz-client PRIVATE ${Z3_LIBRARIES})
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(fuzz-client PRIVATE ${tinyxml2_LIBRARIES})
+ target_link_libraries(fuzz-client PRIVATE tinyxml2)
endif()
add_executable(translate EXCLUDE_FROM_ALL
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 082ca253a..2cc49fe99 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -26,7 +26,7 @@ if (BUILD_TESTS)
endif()
endif()
if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2)
- target_link_libraries(testrunner ${tinyxml2_LIBRARIES})
+ target_link_libraries(testrunner tinyxml2)
endif()
if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
find_package(tinyxml2 QUIET)
- if (NOT tinyxml2_FOUND)
+ if (tinyxml2_FOUND)
+ set(tinyxml2_LIBRARIES "tinyxml2")
+ else()
find_library(tinyxml2_LIBRARIES tinyxml2)
if (NOT tinyxml2_LIBRARIES)
message(FATAL_ERROR "tinyxml2 has not been found")