From 5c4559a998d74c5b79add28491d52a53a8c532c9 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:34:33 +0100 Subject: [PATCH 01/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index ca1bcf73fc569..390feee9912bf 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,4 +1,10 @@ sources: + "2.9.1": + url: "https://github.com/danmar/cppcheck/archive/2.9.1.tar.gz" + sha256: "fa4350f48df978dcc02d8769376ff5517d7f1e77d9f79f636c79912f4c0cff9c" + "2.8.2": + url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" + sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" "2.7.5": url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz" sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78" @@ -6,6 +12,20 @@ sources: url: "https://github.com/danmar/cppcheck/archive/2.7.4.tar.gz" sha256: "f0558c497b7807763325f3a821f1c72b743e5d888b037b8d32157dd07d6c26e1" patches: + "2.9.1": + - patch_file: "patches/0001-cmake-source-dir-2.5.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-htmlreport-python3.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-handle-exename-on-macos.patch" + base_path: "source_subfolder" + "2.8.2": + - patch_file: "patches/0001-cmake-source-dir-2.5.patch" + base_path: "source_subfolder" + - patch_file: "patches/0002-htmlreport-python3.patch" + base_path: "source_subfolder" + - patch_file: "patches/0003-handle-exename-on-macos.patch" + base_path: "source_subfolder" "2.7.5": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" base_path: "source_subfolder" From 114d9dabac9230d0d0bc0873394b4d4f4ba568be Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:35:25 +0100 Subject: [PATCH 02/64] Update config.yml --- recipes/cppcheck/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index cd8c614f41055..c0b9c30406ef4 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,4 +1,8 @@ versions: + "2.9.1": + folder: all + "2.8.2": + folder: all "2.7.5": folder: all "2.7.4": From a50f63782a45fcc73bf9932be02bca422c2d3f89 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:35:49 +0100 Subject: [PATCH 03/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 71 ++++++++++++++----------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 7f61d3fda6eed..95b434da2807d 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,5 +1,7 @@ -from conans import ConanFile, CMake, tools -import functools +from conan import ConanFile, conan_version +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, get, patch, replace_in_file, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.33.0" @@ -12,26 +14,13 @@ class CppcheckConan(ConanFile): topics = ("Cpp Check", "static analyzer") description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" - generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = {"with_z3": [True, False], "have_rules": [True, False]} default_options = {"with_z3": True, "have_rules": True} exports_sources = ["CMakeLists.txt", "patches/**"] - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - - def _patch_sources(self): - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) - tools.replace_in_file(os.path.join(self._source_subfolder, "cli", "CMakeLists.txt"), - "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", - "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") + def layout(self): + cmake_layout(self) def requirements(self): if self.options.with_z3: @@ -40,35 +29,41 @@ def requirements(self): self.requires("pcre/8.45") def source(self): - tools.get(**self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) + get(**self.conan_data["sources"][self.version], strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["USE_Z3"] = self.options.with_z3 - cmake.definitions["HAVE_RULES"] = self.options.have_rules - cmake.definitions["USE_MATCHCOMPILER"] = "Auto" - cmake.definitions["ENABLE_OSS_FUZZ"] = False - cmake.configure(build_folder=self._build_subfolder) - return cmake + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_Z3"] = self.options.with_z3 + tc.variables["HAVE_RULES"] = self.options.have_rules + tc.variables["USE_MATCHCOMPILER"] = "Auto" + tc.variables["ENABLE_OSS_FUZZ"] = False + tc.generate() + + deps = CMakeDeps(self) + deps.generate() def build(self): - self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + apply_conandata_patches(self) + replace_in_file(os.path.join(self.source_folder, "cli", "CMakeLists.txt"), + "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", + "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") + cmake.configure() cmake.build() def package(self): - self.copy("COPYING", dst="licenses", src=self._source_subfolder) - self.copy("*", dst=os.path.join("bin","cfg"), src=os.path.join(self._source_subfolder,"cfg")) - self.copy("cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self._source_subfolder,"htmlreport")) - cmake = self._configure_cmake() + copy("COPYING", dst="licenses", src=self.source_folder) + copy("*", dst=os.path.join("bin", "cfg"), src=os.path.join(self.source_folder, "cfg")) + copy("cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self.source_folder, "htmlreport")) + cmake = CMake(self) cmake.install() - tools.rmdir(os.path.join(self.package_folder, "share")) + rmdir(os.path.join(self.package_folder, "share")) def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) - self.env_info.PATH.append(bin_folder) - # This is required to run the python script on windows, as we cannot simply add it to the PATH - self.env_info.CPPCHECK_HTMLREPORT = os.path.join(bin_folder, "cppcheck-htmlreport") + self.buildenv_info.prepend_path("PATH", self.package_folder) + self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", os.path.join(bin_folder, "cppcheck-htmlreport")) From 9b03147ff94c91f2620de83172670e72a593c1bb Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:43:33 +0100 Subject: [PATCH 04/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 95b434da2807d..593397d75e8be 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,7 +1,6 @@ -from conan import ConanFile, conan_version +from conan import ConanFile, from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, patch, replace_in_file, rmdir -from conan.tools.scm import Version +from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir import os required_conan_version = ">=1.33.0" @@ -45,19 +44,19 @@ def generate(self): def build(self): cmake = CMake(self) apply_conandata_patches(self) - replace_in_file(os.path.join(self.source_folder, "cli", "CMakeLists.txt"), + replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") cmake.configure() cmake.build() def package(self): - copy("COPYING", dst="licenses", src=self.source_folder) - copy("*", dst=os.path.join("bin", "cfg"), src=os.path.join(self.source_folder, "cfg")) - copy("cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self.source_folder, "htmlreport")) + copy(self, "COPYING", dst="licenses", src=self.source_folder) + copy(self, "*", dst=os.path.join("bin", "cfg"), src=os.path.join(self.source_folder, "cfg")) + copy(self, "cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self.source_folder, "htmlreport")) cmake = CMake(self) cmake.install() - rmdir(os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.includedirs = [] From f67f5a983879c3e458426c03fd9f592e58e28b3a Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:53:35 +0100 Subject: [PATCH 05/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 390feee9912bf..b0900d3de9337 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -17,26 +17,18 @@ patches: base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-handle-exename-on-macos.patch" - base_path: "source_subfolder" "2.8.2": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-handle-exename-on-macos.patch" - base_path: "source_subfolder" "2.7.5": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-handle-exename-on-macos.patch" - base_path: "source_subfolder" "2.7.4": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" base_path: "source_subfolder" - - patch_file: "patches/0003-handle-exename-on-macos.patch" - base_path: "source_subfolder" From 05a1f72275c28a7372a72676e50a24f7dfa966c6 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 07:54:06 +0100 Subject: [PATCH 06/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Martin Delille --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 593397d75e8be..e2dac0b58c296 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile, +from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir import os From 10f9d5e07a0f1e35060db136ba3ff929573cbb83 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 08:51:44 +0100 Subject: [PATCH 07/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index e2dac0b58c296..679a60cee4d0d 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -28,7 +28,7 @@ def requirements(self): self.requires("pcre/8.45") def source(self): - get(**self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) From 96765522b0dc13e977e59c6cdac212f607630f59 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 09:18:45 +0100 Subject: [PATCH 08/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index b0900d3de9337..7b766c7609630 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -8,27 +8,13 @@ sources: "2.7.5": url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz" sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78" - "2.7.4": - url: "https://github.com/danmar/cppcheck/archive/2.7.4.tar.gz" - sha256: "f0558c497b7807763325f3a821f1c72b743e5d888b037b8d32157dd07d6c26e1" patches: "2.9.1": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" - base_path: "source_subfolder" "2.8.2": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" - base_path: "source_subfolder" "2.7.5": - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - base_path: "source_subfolder" - patch_file: "patches/0002-htmlreport-python3.patch" - base_path: "source_subfolder" - "2.7.4": - - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - base_path: "source_subfolder" - - patch_file: "patches/0002-htmlreport-python3.patch" - base_path: "source_subfolder" From 4063067dca1e41f95e469b92318da749d5b3f7fb Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 09:23:57 +0100 Subject: [PATCH 09/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 679a60cee4d0d..16333ca9099bd 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir import os -required_conan_version = ">=1.33.0" +required_conan_version = ">=1.35.0" class CppcheckConan(ConanFile): From 86b9e345b3dd2dd83dbef376793531cfe7c86ab4 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:18:31 +0100 Subject: [PATCH 10/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 7b766c7609630..4f0df1b74de9e 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -8,13 +8,3 @@ sources: "2.7.5": url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz" sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78" -patches: - "2.9.1": - - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - - patch_file: "patches/0002-htmlreport-python3.patch" - "2.8.2": - - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - - patch_file: "patches/0002-htmlreport-python3.patch" - "2.7.5": - - patch_file: "patches/0001-cmake-source-dir-2.5.patch" - - patch_file: "patches/0002-htmlreport-python3.patch" From 0f2b2b3151916b9f200016f874505151b7a6be20 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:19:02 +0100 Subject: [PATCH 11/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 16333ca9099bd..b8912301a89d5 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,9 +1,9 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, get, replace_in_file, rmdir +from conan.tools.files import copy, get, replace_in_file import os -required_conan_version = ">=1.35.0" +required_conan_version = ">=1.46.0" class CppcheckConan(ConanFile): @@ -43,7 +43,8 @@ def generate(self): def build(self): cmake = CMake(self) - apply_conandata_patches(self) + replace_in_file(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + replace_in_file(self, os.path.join(self.source_folder, "htmlreport", "cppcheck-htmlreport"), "#!/usr/bin/env python", "#!/usr/bin/env python3") replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") @@ -51,12 +52,10 @@ def build(self): cmake.build() def package(self): - copy(self, "COPYING", dst="licenses", src=self.source_folder) - copy(self, "*", dst=os.path.join("bin", "cfg"), src=os.path.join(self.source_folder, "cfg")) - copy(self, "cppcheck-htmlreport", dst=os.path.join("bin"), src=os.path.join(self.source_folder, "htmlreport")) + copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder)) + copy(self, "cppcheck-htmlreport", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "htmlreport")) cmake = CMake(self) cmake.install() - rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.includedirs = [] @@ -64,5 +63,5 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) - self.buildenv_info.prepend_path("PATH", self.package_folder) + self.buildenv_info.prepend_path("PATH", bin_folder) self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", os.path.join(bin_folder, "cppcheck-htmlreport")) From 1dd7b53c0217f76961bb7b97719142b00257043b Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:19:21 +0100 Subject: [PATCH 12/64] Update config.yml --- recipes/cppcheck/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index c0b9c30406ef4..2f62f9f537e53 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -5,5 +5,3 @@ versions: folder: all "2.7.5": folder: all - "2.7.4": - folder: all From a452dccbb4dda631bb26529e7dd701df357ffecf Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:20:23 +0100 Subject: [PATCH 13/64] Delete recipes/cppcheck/all/patches directory --- .../patches/0001-cmake-source-dir-2.5.patch | 36 ------------------- .../all/patches/0001-cmake-source-dir.patch | 35 ------------------ .../all/patches/0002-htmlreport-python3.patch | 10 ------ .../0003-handle-exename-on-macos.patch | 35 ------------------ 4 files changed, 116 deletions(-) delete mode 100644 recipes/cppcheck/all/patches/0001-cmake-source-dir-2.5.patch delete mode 100644 recipes/cppcheck/all/patches/0001-cmake-source-dir.patch delete mode 100644 recipes/cppcheck/all/patches/0002-htmlreport-python3.patch delete mode 100644 recipes/cppcheck/all/patches/0003-handle-exename-on-macos.patch diff --git a/recipes/cppcheck/all/patches/0001-cmake-source-dir-2.5.patch b/recipes/cppcheck/all/patches/0001-cmake-source-dir-2.5.patch deleted file mode 100644 index 06286552a0736..0000000000000 --- a/recipes/cppcheck/all/patches/0001-cmake-source-dir-2.5.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 100f9a9edab3ae26b1736f79dc2f9b875f627cce..6e810d508afb79f015286b92a4eeff53e497b9c8 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -4,19 +4,19 @@ foreach(file ${srcs_lib}) - set(src "${CMAKE_BINARY_DIR}/lib/build/mc_${file}") - set_source_files_properties(${src} PROPERTIES GENERATED TRUE) - else() -- set(src "${CMAKE_SOURCE_DIR}/lib/${file}") -+ set(src "${PROJECT_SOURCE_DIR}/lib/${file}") - endif() - set(srcs_tools ${srcs_tools} ${src}) - endforeach() - - add_executable(dmake EXCLUDE_FROM_ALL - dmake.cpp -- ${CMAKE_SOURCE_DIR}/cli/filelister.cpp -+ ${PROJECT_SOURCE_DIR}/cli/filelister.cpp - ${srcs_tools} -- ${CMAKE_SOURCE_DIR}/lib/utils.cpp -- ${CMAKE_SOURCE_DIR}/externals/simplecpp/simplecpp.cpp -+ ${PROJECT_SOURCE_DIR}/lib/utils.cpp -+ ${PROJECT_SOURCE_DIR}/externals/simplecpp/simplecpp.cpp - ) --target_include_directories(dmake PRIVATE ${CMAKE_SOURCE_DIR}/cli ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp) -+target_include_directories(dmake PRIVATE ${PROJECT_SOURCE_DIR}/cli ${PROJECT_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/externals/simplecpp) - if (WIN32 AND NOT BORLAND) - if(NOT MINGW) - target_link_libraries(dmake Shlwapi.lib) -@@ -26,5 +26,5 @@ if (WIN32 AND NOT BORLAND) - endif() - - add_custom_target(run-dmake $ -- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - DEPENDS dmake) diff --git a/recipes/cppcheck/all/patches/0001-cmake-source-dir.patch b/recipes/cppcheck/all/patches/0001-cmake-source-dir.patch deleted file mode 100644 index 95e8658caedb3..0000000000000 --- a/recipes/cppcheck/all/patches/0001-cmake-source-dir.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt -index 303b8d55f77cd36bc597ddfc406bc5fe7c2992e5..e25948fa14664d9a8b758586a75369ecde111ddb 100644 ---- a/tools/CMakeLists.txt -+++ b/tools/CMakeLists.txt -@@ -4,23 +4,23 @@ foreach(file ${srcs_lib}) - set(src "${CMAKE_BINARY_DIR}/lib/build/mc_${file}") - set_source_files_properties(${src} PROPERTIES GENERATED TRUE) - else() -- set(src "${CMAKE_SOURCE_DIR}/lib/${file}") -+ set(src "${PROJECT_SOURCE_DIR}/lib/${file}") - endif() - set(srcs_tools ${srcs_tools} ${src}) - endforeach() - - add_executable(dmake EXCLUDE_FROM_ALL - dmake.cpp -- ${CMAKE_SOURCE_DIR}/cli/filelister.cpp -+ ${PROJECT_SOURCE_DIR}/cli/filelister.cpp - ${srcs_tools} -- ${CMAKE_SOURCE_DIR}/lib/utils.cpp -- ${CMAKE_SOURCE_DIR}/externals/simplecpp/simplecpp -+ ${PROJECT_SOURCE_DIR}/lib/utils.cpp -+ ${PROJECT_SOURCE_DIR}/externals/simplecpp/simplecpp - ) --target_include_directories(dmake PRIVATE ${CMAKE_SOURCE_DIR}/cli ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp) -+target_include_directories(dmake PRIVATE ${PROJECT_SOURCE_DIR}/cli ${PROJECT_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/externals/simplecpp) - if (WIN32 AND NOT BORLAND) - target_link_libraries(dmake Shlwapi.lib) - endif() - - add_custom_target(run-dmake $ -- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - DEPENDS dmake) -\ No newline at end of file diff --git a/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch b/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch deleted file mode 100644 index 2012ae5551b1b..0000000000000 --- a/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport -index 97a3af50d..b45cebf31 100755 ---- a/htmlreport/cppcheck-htmlreport -+++ b/htmlreport/cppcheck-htmlreport -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - from __future__ import unicode_literals - diff --git a/recipes/cppcheck/all/patches/0003-handle-exename-on-macos.patch b/recipes/cppcheck/all/patches/0003-handle-exename-on-macos.patch deleted file mode 100644 index 5975775352f74..0000000000000 --- a/recipes/cppcheck/all/patches/0003-handle-exename-on-macos.patch +++ /dev/null @@ -1,35 +0,0 @@ -commit 3b54e7610c8e512432fefd02c047ade142cde19a -Author: Martin Delille -Date: Sun May 1 19:32:12 2022 +0200 - - Handle exename on macos - -diff --git a/cli/main.cpp b/cli/main.cpp -index ca48497d2..dae782ce6 100644 ---- a/cli/main.cpp -+++ b/cli/main.cpp -@@ -76,6 +76,12 @@ - static char exename[1024] = {0}; - #endif - -+#if defined(__APPLE__) -+#include -+ -+static char exename[1024] = {0}; -+#endif -+ - /** - * Main function of cppcheck - * -@@ -95,6 +101,11 @@ int main(int argc, char* argv[]) - GetModuleFileNameA(nullptr, exename, sizeof(exename)/sizeof(exename[0])-1); - argv[0] = exename; - #endif -+#if defined(__APPLE__) -+ uint32_t size = sizeof(exename); -+ _NSGetExecutablePath(exename, &size); -+ argv[0] = exename; -+#endif - // *INDENT-OFF* - #ifdef NDEBUG - try { From 4339b8a84f102eae36d5b21f6a41d429000049e2 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:20:53 +0100 Subject: [PATCH 14/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 5aa61b686254c..b335f0135ff29 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -1,20 +1,20 @@ -from conans import ConanFile, tools -import sys +from conan import ConanFile +from conan.tools.build import cross_building import os -import shutil +import sys class TestPackageConan(ConanFile): settings = "os", "arch" + generators = "VirtualBuildEnv" def test(self): - shutil.copy(os.path.join(self.source_folder, "file_to_check.cpp"), - os.path.join(self.build_folder, "file_to_check.cpp")) - if not tools.cross_building(self.settings): + if not cross_building(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, run_environment=True) - # On windows we need to explicitly use python to run the python script if self.settings.os == 'Windows': - self.run("{} {} -h".format(sys.executable, tools.get_env("CPPCHECK_HTMLREPORT"))) + # Unable to work with Environment variable CPPCHECK_HTML_REPORT + #elf.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) + pass else: self.run("cppcheck-htmlreport -h", run_environment=True) From 5bbf06222dc0b0a373010ec9cb680e6ddcab302a Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:42:21 +0100 Subject: [PATCH 15/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b8912301a89d5..a2b8806e82b88 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import copy, get, replace_in_file +from conan.tools.files import copy, get, replace_in_file, rmdir import os required_conan_version = ">=1.46.0" @@ -53,9 +53,11 @@ def build(self): def package(self): copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=os.path.join(self.source_folder)) + copy(self, "*", dst=os.path.join(self.package_folder, "bin", "cfg"), src=os.path.join(self.source_folder, "cfg")) copy(self, "cppcheck-htmlreport", dst=os.path.join(self.package_folder, "bin"), src=os.path.join(self.source_folder, "htmlreport")) cmake = CMake(self) cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) def package_info(self): self.cpp_info.includedirs = [] From df72e43d5175be6622e528bc56b47b734f2e1348 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:52:31 +0100 Subject: [PATCH 16/64] Update recipes/cppcheck/all/test_package/conanfile.py Co-authored-by: Uilian Ries --- recipes/cppcheck/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index b335f0135ff29..e5281256616dd 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -11,7 +11,7 @@ class TestPackageConan(ConanFile): def test(self): if not cross_building(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", - cwd=self.source_folder, run_environment=True) + cwd=self.source_folder, env="conanbuild") if self.settings.os == 'Windows': # Unable to work with Environment variable CPPCHECK_HTML_REPORT #elf.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) From ec1e2ec61c3d139be9f9d13682b2e6af0fd80657 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:52:55 +0100 Subject: [PATCH 17/64] Update recipes/cppcheck/all/test_package/conanfile.py Co-authored-by: Uilian Ries --- recipes/cppcheck/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index e5281256616dd..18eaa71b38f79 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -1,5 +1,5 @@ from conan import ConanFile -from conan.tools.build import cross_building +from conan.tools.build import can_build import os import sys From 72cd7cbeb8cc6f76ba17326ef17589e5933e32f3 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:53:07 +0100 Subject: [PATCH 18/64] Update recipes/cppcheck/all/test_package/conanfile.py Co-authored-by: Uilian Ries --- recipes/cppcheck/all/test_package/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 18eaa71b38f79..9f5e82e0c54fb 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -7,6 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch" generators = "VirtualBuildEnv" + test_type = "explicit" def test(self): if not cross_building(self): From ebc78040f5d00e0248fd0089fc1a4ba50269452f Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:54:19 +0100 Subject: [PATCH 19/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index a2b8806e82b88..484c6a0616eab 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -65,5 +65,5 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) - self.buildenv_info.prepend_path("PATH", bin_folder) - self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", os.path.join(bin_folder, "cppcheck-htmlreport")) + self.env_info.PATH.append(bin_folder) + self.env_info.CPPCHECK_HTMLREPORT = os.path.join(bin_folder, "cppcheck-htmlreport") From 976c1124b460dea732095aebff78ff11ffac0bea Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 22:57:27 +0100 Subject: [PATCH 20/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 9f5e82e0c54fb..1a6f6f7ca508c 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -1,7 +1,4 @@ from conan import ConanFile -from conan.tools.build import can_build -import os -import sys class TestPackageConan(ConanFile): From b5a038ff711bfa67a30bc30835f0bf86751fd453 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 14 Nov 2022 23:00:44 +0100 Subject: [PATCH 21/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 1a6f6f7ca508c..4d0f101606384 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.build import can_run class TestPackageConan(ConanFile): @@ -7,7 +8,7 @@ class TestPackageConan(ConanFile): test_type = "explicit" def test(self): - if not cross_building(self): + if not can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, env="conanbuild") if self.settings.os == 'Windows': From d77dd0d849bca3fa2e6b6f140145e7da04d5c123 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 16:44:37 +0100 Subject: [PATCH 22/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 484c6a0616eab..f9b674c755baa 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -14,6 +14,7 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain" options = {"with_z3": [True, False], "have_rules": [True, False]} default_options = {"with_z3": True, "have_rules": True} exports_sources = ["CMakeLists.txt", "patches/**"] From dd2acda3825d4cdeda4b8eada83f78cac6c522c1 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 17:31:42 +0100 Subject: [PATCH 23/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index f9b674c755baa..6b39af6742b99 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -14,7 +14,7 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "CMakeToolchain" + generators = "CMake", "CMakeDeps", "CMakeToolchain" options = {"with_z3": [True, False], "have_rules": [True, False]} default_options = {"with_z3": True, "have_rules": True} exports_sources = ["CMakeLists.txt", "patches/**"] From 65da535a0a22f2241e859418c571f2980e05d870 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 17:43:52 +0100 Subject: [PATCH 24/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 6b39af6742b99..594fb8a6285c4 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -14,7 +14,7 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - generators = "CMake", "CMakeDeps", "CMakeToolchain" + generators = "cmake" options = {"with_z3": [True, False], "have_rules": [True, False]} default_options = {"with_z3": True, "have_rules": True} exports_sources = ["CMakeLists.txt", "patches/**"] From e2f9b3279a90187d9d3b5b4f67f6c771d2735cca Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:21:27 +0100 Subject: [PATCH 25/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 594fb8a6285c4..ab9b06cd9c3b9 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -14,10 +14,8 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - generators = "cmake" options = {"with_z3": [True, False], "have_rules": [True, False]} default_options = {"with_z3": True, "have_rules": True} - exports_sources = ["CMakeLists.txt", "patches/**"] def layout(self): cmake_layout(self) From ea1e5e7e0f4ae4276ffb912cde6d1e3b1713cc0e Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 19:01:11 +0100 Subject: [PATCH 26/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index ab9b06cd9c3b9..7fef1f47e9ce8 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -14,15 +14,13 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - options = {"with_z3": [True, False], "have_rules": [True, False]} - default_options = {"with_z3": True, "have_rules": True} + options = {"have_rules": [True, False]} + default_options = {"have_rules": True} def layout(self): cmake_layout(self) def requirements(self): - if self.options.with_z3: - self.requires("z3/4.8.8") if self.options.have_rules: self.requires("pcre/8.45") @@ -31,7 +29,6 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["USE_Z3"] = self.options.with_z3 tc.variables["HAVE_RULES"] = self.options.have_rules tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False From e4c366b979a5d49bbf8aa72a14bc73209ffc2664 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 19:01:27 +0100 Subject: [PATCH 27/64] Update config.yml --- recipes/cppcheck/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index 2f62f9f537e53..c3883d0fdaefc 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -3,5 +3,3 @@ versions: folder: all "2.8.2": folder: all - "2.7.5": - folder: all From a24240a9b2b9966991a7604f89df83b022c07251 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 19:05:34 +0100 Subject: [PATCH 28/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 4f0df1b74de9e..9b22e97688da5 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -5,6 +5,3 @@ sources: "2.8.2": url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" - "2.7.5": - url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz" - sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78" From bcc35341b4e6041db62163c7662ff92eafab22d9 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Tue, 15 Nov 2022 22:33:20 +0100 Subject: [PATCH 29/64] changes --- recipes/cppcheck/all/conanfile.py | 6 ++++++ recipes/cppcheck/all/test_package/conanfile.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 7fef1f47e9ce8..b6ce3d4c199ca 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,4 +1,6 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import copy, get, replace_in_file, rmdir import os @@ -17,6 +19,10 @@ class CppcheckConan(ConanFile): options = {"have_rules": [True, False]} default_options = {"have_rules": True} + def validate(self): + if not can_run(self): + raise ConanInvalidConfiguration("Cross build not possible") + def layout(self): cmake_layout(self) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 4d0f101606384..5e591b1aa4949 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -11,9 +11,9 @@ def test(self): if not can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, env="conanbuild") - if self.settings.os == 'Windows': + if self.settings.os == "Windows": # Unable to work with Environment variable CPPCHECK_HTML_REPORT - #elf.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) + #self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) pass else: self.run("cppcheck-htmlreport -h", run_environment=True) From f554350d2fd7aa5ae036a0df26f59d1c2008be9f Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 16 Nov 2022 07:35:50 +0100 Subject: [PATCH 30/64] changes --- recipes/cppcheck/all/conandata.yml | 4 ++-- recipes/cppcheck/all/conanfile.py | 1 + recipes/cppcheck/all/test_package/conanfile.py | 3 +-- recipes/cppcheck/config.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 9b22e97688da5..02935a2ce689f 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,7 +1,7 @@ sources: "2.9.1": - url: "https://github.com/danmar/cppcheck/archive/2.9.1.tar.gz" - sha256: "fa4350f48df978dcc02d8769376ff5517d7f1e77d9f79f636c79912f4c0cff9c" + url: "https://github.com/danmar/cppcheck/archive/2.9.2.tar.gz" + sha256: "93920d24d4442856bf7916ee0e3fc31308bc23948e7029b4fd332e01cac63c3e" "2.8.2": url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b6ce3d4c199ca..b7e0390d9d867 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -46,6 +46,7 @@ def generate(self): def build(self): cmake = CMake(self) replace_in_file(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), "PCRE_LIBRARY pcre", "PCRE_LIBRARY pcre pcred") replace_in_file(self, os.path.join(self.source_folder, "htmlreport", "cppcheck-htmlreport"), "#!/usr/bin/env python", "#!/usr/bin/env python3") replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 5e591b1aa4949..a3d3999964610 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -13,7 +13,6 @@ def test(self): cwd=self.source_folder, env="conanbuild") if self.settings.os == "Windows": # Unable to work with Environment variable CPPCHECK_HTML_REPORT - #self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) - pass + self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) else: self.run("cppcheck-htmlreport -h", run_environment=True) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index c3883d0fdaefc..12c8c718506e9 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -1,5 +1,5 @@ versions: - "2.9.1": + "2.9.2": folder: all "2.8.2": folder: all From f37bbc1271ff6c702fdef876dce30219b3d67d19 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 16 Nov 2022 08:02:27 +0100 Subject: [PATCH 31/64] Update conandata.yml --- recipes/cppcheck/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index 02935a2ce689f..f15a4054599f2 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -1,5 +1,5 @@ sources: - "2.9.1": + "2.9.2": url: "https://github.com/danmar/cppcheck/archive/2.9.2.tar.gz" sha256: "93920d24d4442856bf7916ee0e3fc31308bc23948e7029b4fd332e01cac63c3e" "2.8.2": From ad4c120962f1367b9e489c2fd64343f5b3158559 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 16 Nov 2022 08:10:04 +0100 Subject: [PATCH 32/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index a3d3999964610..e8f0e039fb4d4 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.tools.build import can_run +import sys class TestPackageConan(ConanFile): From b9505d02ed586ee16c9e91309f5022a487fb6724 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:07:28 +0100 Subject: [PATCH 33/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b7e0390d9d867..12c752b16b155 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -46,7 +46,7 @@ def generate(self): def build(self): cmake = CMake(self) replace_in_file(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") - replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), "PCRE_LIBRARY pcre", "PCRE_LIBRARY pcre pcred") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), "PCRE_LIBRARY pcre", "PCRE_LIBRARY NAMES pcre pcred") replace_in_file(self, os.path.join(self.source_folder, "htmlreport", "cppcheck-htmlreport"), "#!/usr/bin/env python", "#!/usr/bin/env python3") replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", From 37302c6ccd8c7e1c8cf4c68f6383e00834c104bf Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 06:35:47 +0100 Subject: [PATCH 34/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 12c752b16b155..b5a91d938d459 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -16,8 +16,8 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - options = {"have_rules": [True, False]} - default_options = {"have_rules": True} + options = {"with_z3": [True, False, "deprecated"], "have_rules": [True, False]} + default_options = {"with_z3": "deprecated", "have_rules": True} def validate(self): if not can_run(self): @@ -25,6 +25,13 @@ def validate(self): def layout(self): cmake_layout(self) + + def configure(self): + if self.options.with_z3 != "deprecated": + self.output.warn("with_z3 option is deprecated, do not use anymore.") + + def package_id(self): + del self.info.options.with_z3 def requirements(self): if self.options.have_rules: From a66c5a1dcfe7eeba4bb545a50e0e18a05508347d Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 20:51:37 +0100 Subject: [PATCH 35/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b5a91d938d459..b134f7b533ee4 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -12,24 +12,20 @@ class CppcheckConan(ConanFile): name = "cppcheck" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/danmar/cppcheck" - topics = ("Cpp Check", "static analyzer") + topics = ("cpp check", "static analyzer") description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" options = {"with_z3": [True, False, "deprecated"], "have_rules": [True, False]} default_options = {"with_z3": "deprecated", "have_rules": True} - def validate(self): - if not can_run(self): - raise ConanInvalidConfiguration("Cross build not possible") - def layout(self): cmake_layout(self) - + def configure(self): if self.options.with_z3 != "deprecated": self.output.warn("with_z3 option is deprecated, do not use anymore.") - + def package_id(self): del self.info.options.with_z3 @@ -58,6 +54,8 @@ def build(self): replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") + replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "add_dependencies(cppcheck run-dmake)", "") + cmake.configure() cmake.build() From 42952e5542f017b958899e6528c9b97e23186def Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 22:14:59 +0100 Subject: [PATCH 36/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b134f7b533ee4..46baac0511238 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -12,7 +12,7 @@ class CppcheckConan(ConanFile): name = "cppcheck" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/danmar/cppcheck" - topics = ("cpp check", "static analyzer") + topics = ("code quality", "static analyzer", "linter") description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" From 99c3348d4b01f8dc69cd988ef4aa29305c30d4ad Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 22:15:06 +0100 Subject: [PATCH 37/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 46baac0511238..485e5964f8bc4 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,6 +1,4 @@ from conan import ConanFile -from conan.errors import ConanInvalidConfiguration -from conan.tools.build import can_run from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import copy, get, replace_in_file, rmdir import os From b9456c11f704bf89e92c8b26597a67e4ca36e6e7 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 22:15:46 +0100 Subject: [PATCH 38/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index e8f0e039fb4d4..9c590c623a626 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -9,7 +9,7 @@ class TestPackageConan(ConanFile): test_type = "explicit" def test(self): - if not can_run(self): + if can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, env="conanbuild") if self.settings.os == "Windows": From 25679b17ef00f776d03edaabf7dcd93cc4f0968a Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 17 Nov 2022 22:16:28 +0100 Subject: [PATCH 39/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 485e5964f8bc4..7d2e0d8e18eee 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -46,7 +46,6 @@ def generate(self): def build(self): cmake = CMake(self) - replace_in_file(self, os.path.join(self.source_folder, "tools", "CMakeLists.txt"), "CMAKE_SOURCE_DIR", "PROJECT_SOURCE_DIR") replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), "PCRE_LIBRARY pcre", "PCRE_LIBRARY NAMES pcre pcred") replace_in_file(self, os.path.join(self.source_folder, "htmlreport", "cppcheck-htmlreport"), "#!/usr/bin/env python", "#!/usr/bin/env python3") replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), From ca0d6d610c81b90f657a14c60728db97ff6f9251 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Fri, 18 Nov 2022 17:16:30 +0100 Subject: [PATCH 40/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Martin Delille --- recipes/cppcheck/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 7d2e0d8e18eee..b83c51db87a88 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -71,4 +71,7 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) self.env_info.PATH.append(bin_folder) - self.env_info.CPPCHECK_HTMLREPORT = os.path.join(bin_folder, "cppcheck-htmlreport") + self.runenv_info.append("PATH", bin_folder) + cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") + self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport + self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) From f5cc2d7106239d71abd4adead90d3358af36b3f8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 21 Nov 2022 21:57:38 +0100 Subject: [PATCH 41/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index b83c51db87a88..ca69985ebec22 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -71,7 +71,7 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) self.env_info.PATH.append(bin_folder) - self.runenv_info.append("PATH", bin_folder) + self.buildenv_info.append("PATH", bin_folder) cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport - self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) + self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) From bef7fb4602863c4e5314dd48259e01f60f3b21ee Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 21 Nov 2022 22:22:56 +0100 Subject: [PATCH 42/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 9c590c623a626..b26f6c117986a 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -5,13 +5,13 @@ class TestPackageConan(ConanFile): settings = "os", "arch" - generators = "VirtualBuildEnv" + generators = "VirtualRunEnv" test_type = "explicit" def test(self): if can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", - cwd=self.source_folder, env="conanbuild") + cwd=self.source_folder, env="conanrun") if self.settings.os == "Windows": # Unable to work with Environment variable CPPCHECK_HTML_REPORT self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) From ef656c17d029069c5918483460abaff3b6cb3ef2 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Mon, 21 Nov 2022 23:06:35 +0100 Subject: [PATCH 43/64] Update conanfile.py --- recipes/cppcheck/all/test_package/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index b26f6c117986a..33599075ff7a2 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -11,9 +11,9 @@ class TestPackageConan(ConanFile): def test(self): if can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", - cwd=self.source_folder, env="conanrun") + cwd=self.source_folder, run_environment=True) if self.settings.os == "Windows": # Unable to work with Environment variable CPPCHECK_HTML_REPORT - self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", run_environment=True) + self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", env="conanrun") else: self.run("cppcheck-htmlreport -h", run_environment=True) From d6f506764de81c05f277dd907b9b4effcb0064b6 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 23 Nov 2022 09:00:15 +0100 Subject: [PATCH 44/64] get test package working --- recipes/cppcheck/all/conanfile.py | 4 ++-- recipes/cppcheck/all/test_package/conanfile.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index ca69985ebec22..4e538a86d2f78 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -71,7 +71,7 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) self.env_info.PATH.append(bin_folder) - self.buildenv_info.append("PATH", bin_folder) + self.runenv_info.append_path("PATH", bin_folder) cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport - self.buildenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) + self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 33599075ff7a2..804d9aba84fe7 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -8,12 +8,15 @@ class TestPackageConan(ConanFile): generators = "VirtualRunEnv" test_type = "explicit" + def requirements(self): + self.requires(self.tested_reference_str) + def test(self): if can_run(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, run_environment=True) if self.settings.os == "Windows": # Unable to work with Environment variable CPPCHECK_HTML_REPORT - self.run(f"{sys.executable} %CPPCHECK_HTML_REPORT% -h", env="conanrun") + self.run(f"{sys.executable} %CPPCHECK_HTMLREPORT% -h", run_environment=True) else: self.run("cppcheck-htmlreport -h", run_environment=True) From d7a26a79875f1059aac83fa89281b2e59bce2cc8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 23 Nov 2022 09:15:11 +0100 Subject: [PATCH 45/64] add v1 test package --- .../all/test_v1_package/CMakeLists.txt | 8 ++++++++ .../cppcheck/all/test_v1_package/conanfile.py | 18 ++++++++++++++++++ .../all/test_v1_package/file_to_check.cpp | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 recipes/cppcheck/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/cppcheck/all/test_v1_package/conanfile.py create mode 100644 recipes/cppcheck/all/test_v1_package/file_to_check.cpp diff --git a/recipes/cppcheck/all/test_v1_package/CMakeLists.txt b/recipes/cppcheck/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..925ecbe19e448 --- /dev/null +++ b/recipes/cppcheck/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cppcheck/all/test_v1_package/conanfile.py b/recipes/cppcheck/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..14b7ebe1713c7 --- /dev/null +++ b/recipes/cppcheck/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conan import ConanFile +from conan.tools.build import can_run +import sys + + +class TestPackageConan(ConanFile): + settings = "os", "arch" + generators = "VirtualRunEnv" + + def test(self): + if can_run(self): + self.run("cppcheck --enable=warning,style,performance --std=c++11 .", + cwd=self.source_folder, run_environment=True) + if self.settings.os == "Windows": + # Unable to work with Environment variable CPPCHECK_HTML_REPORT + self.run(f"{sys.executable} %CPPCHECK_HTMLREPORT% -h", run_environment=True) + else: + self.run("cppcheck-htmlreport -h", run_environment=True) diff --git a/recipes/cppcheck/all/test_v1_package/file_to_check.cpp b/recipes/cppcheck/all/test_v1_package/file_to_check.cpp new file mode 100644 index 0000000000000..33c14ce1d76c0 --- /dev/null +++ b/recipes/cppcheck/all/test_v1_package/file_to_check.cpp @@ -0,0 +1,3 @@ +int main() { + return 0; +} From 9474cd84b0c3fb9c9aafec8a9c09eaef99cd5885 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:14:05 +0100 Subject: [PATCH 46/64] moved changes from replace to file to patches --- recipes/cppcheck/all/CMakeLists.txt | 14 ----------- recipes/cppcheck/all/conandata.yml | 15 ++++++++++++ recipes/cppcheck/all/conanfile.py | 23 +++++++++---------- .../0001-cli-remove-dmake-cmake-2.8.patch | 14 +++++++++++ .../patches/0001-cli-remove-dmake-cmake.patch | 14 +++++++++++ .../all/patches/0002-htmlreport-python3.patch | 10 ++++++++ .../patches/0003-pcre-debuglib-name-2.7.patch | 11 +++++++++ .../all/patches/0003-pcre-debuglib-name.patch | 11 +++++++++ .../cppcheck/all/test_package/conanfile.py | 1 - .../all/test_v1_package/CMakeLists.txt | 8 ------- recipes/cppcheck/config.yml | 2 ++ 11 files changed, 88 insertions(+), 35 deletions(-) delete mode 100644 recipes/cppcheck/all/CMakeLists.txt create mode 100644 recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch create mode 100644 recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch create mode 100644 recipes/cppcheck/all/patches/0002-htmlreport-python3.patch create mode 100644 recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch create mode 100644 recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch delete mode 100644 recipes/cppcheck/all/test_v1_package/CMakeLists.txt diff --git a/recipes/cppcheck/all/CMakeLists.txt b/recipes/cppcheck/all/CMakeLists.txt deleted file mode 100644 index b0b16ec6b271c..0000000000000 --- a/recipes/cppcheck/all/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("conanbuildinfo.cmake") -conan_basic_setup(TARGETS) - -# Set include paths -conan_global_flags() - -# Setup libraries to link -set(Z3_LIBRARIES CONAN_PKG::z3) -set(PCRE_LIBRARY CONAN_PKG::pcre) - -add_subdirectory(source_subfolder) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index f15a4054599f2..a4208beceac96 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -5,3 +5,18 @@ sources: "2.8.2": url: "https://github.com/danmar/cppcheck/archive/2.8.2.tar.gz" sha256: "30ba99ab54089c44b83f02e2453da046a7edff5237950d4A0eb1eba4afcb4f45" + "2.7.5": + url: "https://github.com/danmar/cppcheck/archive/2.7.5.tar.gz" + sha256: "6c7ac29e57fa8b3ac7be224510200e579d5a90217e2152591ef46ffc947d8f78" +patches: + "2.9.2": + - patch_file: "patches/0001-cli-remove-dmake-cmake.patch" + - patch_file: "patches/0002-htmlreport-python3.patch" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + "2.8.2": + - patch_file: "patches/0001-cli-remove-dmake-cmake-2.8.patch" + - patch_file: "patches/0002-htmlreport-python3.patch" + - patch_file: "patches/0003-pcre-debuglib-name.patch" + "2.7.5": + - patch_file: "patches/0002-htmlreport-python3.patch" + - patch_file: "patches/0003-pcre-debuglib-name-2.7.patch" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 4e538a86d2f78..a1dd037a6268a 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir +from conan.tools.scm import Version import os required_conan_version = ">=1.46.0" @@ -14,15 +15,18 @@ class CppcheckConan(ConanFile): description = "Cppcheck is an analysis tool for C/C++ code." license = "GPL-3.0-or-later" settings = "os", "arch", "compiler", "build_type" - options = {"with_z3": [True, False, "deprecated"], "have_rules": [True, False]} - default_options = {"with_z3": "deprecated", "have_rules": True} + options = {"with_z3": [True, False], "have_rules": [True, False]} + default_options = {"with_z3": True, "have_rules": True} def layout(self): cmake_layout(self) - def configure(self): - if self.options.with_z3 != "deprecated": - self.output.warn("with_z3 option is deprecated, do not use anymore.") + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if Version(self.version) >= Version("2.8.0"): + del self.options.with_z3 def package_id(self): del self.info.options.with_z3 @@ -46,12 +50,7 @@ def generate(self): def build(self): cmake = CMake(self) - replace_in_file(self, os.path.join(self.source_folder, "cmake", "findDependencies.cmake"), "PCRE_LIBRARY pcre", "PCRE_LIBRARY NAMES pcre pcred") - replace_in_file(self, os.path.join(self.source_folder, "htmlreport", "cppcheck-htmlreport"), "#!/usr/bin/env python", "#!/usr/bin/env python3") - replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), - "RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}", - "DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}") - replace_in_file(self, os.path.join(self.source_folder, "cli", "CMakeLists.txt"), "add_dependencies(cppcheck run-dmake)", "") + apply_conandata_patches(self) cmake.configure() cmake.build() diff --git a/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch new file mode 100644 index 0000000000000..157034975424b --- /dev/null +++ b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake-2.8.patch @@ -0,0 +1,14 @@ +--- a/cli/CMakeLists.txt 2022-07-12 23:11:29.000000000 +0200 ++++ b/cli/CMakeLists.txt 2022-11-23 22:01:29.111581500 +0100 +@@ -45,10 +45,9 @@ + + add_dependencies(cppcheck copy_cfg) + add_dependencies(cppcheck copy_addons) +-add_dependencies(cppcheck run-dmake) + + install(TARGETS cppcheck +- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons} diff --git a/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch new file mode 100644 index 0000000000000..18fff8473a497 --- /dev/null +++ b/recipes/cppcheck/all/patches/0001-cli-remove-dmake-cmake.patch @@ -0,0 +1,14 @@ +--- a/cli/CMakeLists.txt 2022-11-08 20:22:59.000000000 +0100 ++++ b/cli/CMakeLists.txt 2022-11-23 21:33:49.347849300 +0100 +@@ -43,10 +43,9 @@ + + add_dependencies(cppcheck copy_cfg) + add_dependencies(cppcheck copy_addons) +-add_dependencies(cppcheck run-dmake) + + install(TARGETS cppcheck +- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} ++ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} + COMPONENT applications) + + install(FILES ${addons} diff --git a/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch b/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch new file mode 100644 index 0000000000000..2012ae5551b1b --- /dev/null +++ b/recipes/cppcheck/all/patches/0002-htmlreport-python3.patch @@ -0,0 +1,10 @@ +diff --git a/htmlreport/cppcheck-htmlreport b/htmlreport/cppcheck-htmlreport +index 97a3af50d..b45cebf31 100755 +--- a/htmlreport/cppcheck-htmlreport ++++ b/htmlreport/cppcheck-htmlreport +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import unicode_literals + diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch new file mode 100644 index 0000000000000..f9075b827e824 --- /dev/null +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -0,0 +1,11 @@ +--- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 ++++ b/cmake/findDependencies.cmake 2022-11-23 22:10:40.555769900 +0100 +@@ -16,7 +16,7 @@ + + if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) +- find_library(PCRE_LIBRARY pcre) ++ find_library(PCRE_LIBRARY NAMES pcre pcred) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) + message(FATAL_ERROR "pcre dependency for RULES has not been found") + endif() diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch new file mode 100644 index 0000000000000..9431d05ce2a2d --- /dev/null +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name.patch @@ -0,0 +1,11 @@ +--- a/cmake/findDependencies.cmake 2022-11-08 20:22:59.000000000 +0100 ++++ b/cmake/findDependencies.cmake 2022-11-23 21:29:50.222152900 +0100 +@@ -36,7 +36,7 @@ + + if (HAVE_RULES) + find_path(PCRE_INCLUDE pcre.h) +- find_library(PCRE_LIBRARY pcre) ++ find_library(PCRE_LIBRARY NAMES pcre pcred) + if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) + message(FATAL_ERROR "pcre dependency for RULES has not been found") + endif() diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 804d9aba84fe7..87d97d10fc475 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -16,7 +16,6 @@ def test(self): self.run("cppcheck --enable=warning,style,performance --std=c++11 .", cwd=self.source_folder, run_environment=True) if self.settings.os == "Windows": - # Unable to work with Environment variable CPPCHECK_HTML_REPORT self.run(f"{sys.executable} %CPPCHECK_HTMLREPORT% -h", run_environment=True) else: self.run("cppcheck-htmlreport -h", run_environment=True) diff --git a/recipes/cppcheck/all/test_v1_package/CMakeLists.txt b/recipes/cppcheck/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 925ecbe19e448..0000000000000 --- a/recipes/cppcheck/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/cppcheck/config.yml b/recipes/cppcheck/config.yml index 12c8c718506e9..bc6d13a4fc4ca 100644 --- a/recipes/cppcheck/config.yml +++ b/recipes/cppcheck/config.yml @@ -3,3 +3,5 @@ versions: folder: all "2.8.2": folder: all + "2.7.5": + folder: all From 1e32c7fd455d0eda0a116e072da068deb63b758c Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:19:33 +0100 Subject: [PATCH 47/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index a1dd037a6268a..36f635ca96c3d 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -32,6 +32,8 @@ def package_id(self): del self.info.options.with_z3 def requirements(self): + if self.options.with_z3: + self.requires("z3/4.8.8") if self.options.have_rules: self.requires("pcre/8.45") From f4c12e051e1386c2c56ec23b3fafc6d7e37f6ebc Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 06:55:06 +0100 Subject: [PATCH 48/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 36f635ca96c3d..85312703f170d 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -31,11 +31,11 @@ def config_options(self): def package_id(self): del self.info.options.with_z3 - def requirements(self): - if self.options.with_z3: - self.requires("z3/4.8.8") + def build_requirements(self): + if Version(self.version) < Version("2.8.0") and self.options.with_z3: + self.tool_requires("z3/4.8.8") if self.options.have_rules: - self.requires("pcre/8.45") + self.tool_requires("pcre/8.45") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) From a09e6a50c5b48a4db14e6925f83baffdfcccd8f9 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 08:18:21 +0100 Subject: [PATCH 49/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 85312703f170d..ece8abb50331f 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -31,17 +31,19 @@ def config_options(self): def package_id(self): del self.info.options.with_z3 - def build_requirements(self): + def requirements(self): if Version(self.version) < Version("2.8.0") and self.options.with_z3: - self.tool_requires("z3/4.8.8") + self.requires("z3/4.8.8") if self.options.have_rules: - self.tool_requires("pcre/8.45") + self.requires("pcre/8.45") def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) + if Version(self.version) < Version("2.8.0"): + tc.variables["USE_Z3"] = self.options.with_z3 tc.variables["HAVE_RULES"] = self.options.have_rules tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False @@ -53,7 +55,6 @@ def generate(self): def build(self): cmake = CMake(self) apply_conandata_patches(self) - cmake.configure() cmake.build() From 677a868280f323f5666140f8313962480f0a8862 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 09:27:10 +0100 Subject: [PATCH 50/64] Update 0003-pcre-debuglib-name-2.7.patch --- .../all/patches/0003-pcre-debuglib-name-2.7.patch | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index f9075b827e824..74ca92c76e7b1 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -1,7 +1,7 @@ --- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 -+++ b/cmake/findDependencies.cmake 2022-11-23 22:10:40.555769900 +0100 -@@ -16,7 +16,7 @@ - ++++ b/cmake/findDependencies.cmake 2022-11-24 09:22:09.883981500 +0100 +@@ -16,14 +16,14 @@ + if (HAVE_RULES) find_path(PCRE_INCLUDE pcre.h) - find_library(PCRE_LIBRARY pcre) @@ -9,3 +9,11 @@ if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") endif() + endif() + + if (USE_Z3) +- find_package(Z3 QUIET) ++ find_package(z3 QUIET) + if (NOT Z3_FOUND) + find_library(Z3_LIBRARIES z3) + if (NOT Z3_LIBRARIES) From 2e0c5bf23e733388764cd20bbcc5d5799473dff8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 10:21:25 +0100 Subject: [PATCH 51/64] Update 0003-pcre-debuglib-name-2.7.patch --- .../all/patches/0003-pcre-debuglib-name-2.7.patch | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index 74ca92c76e7b1..3c96055a5429a 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -1,6 +1,6 @@ --- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 -+++ b/cmake/findDependencies.cmake 2022-11-24 09:22:09.883981500 +0100 -@@ -16,14 +16,14 @@ ++++ b/cmake/findDependencies.cmake 2022-11-24 10:19:11.665236500 +0100 +@@ -16,7 +16,7 @@ if (HAVE_RULES) find_path(PCRE_INCLUDE pcre.h) @@ -9,11 +9,3 @@ if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") endif() - endif() - - if (USE_Z3) -- find_package(Z3 QUIET) -+ find_package(z3 QUIET) - if (NOT Z3_FOUND) - find_library(Z3_LIBRARIES z3) - if (NOT Z3_LIBRARIES) From f4b5353d054d8d41452b73b5d8599a6a3fabf5a3 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 12:10:23 +0100 Subject: [PATCH 52/64] Update 0003-pcre-debuglib-name-2.7.patch --- .../all/patches/0003-pcre-debuglib-name-2.7.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index 3c96055a5429a..dd9fe431bd97a 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -1,5 +1,5 @@ --- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 -+++ b/cmake/findDependencies.cmake 2022-11-24 10:19:11.665236500 +0100 ++++ b/cmake/findDependencies.cmake 2022-11-24 12:06:28.533888200 +0100 @@ -16,7 +16,7 @@ if (HAVE_RULES) @@ -9,3 +9,12 @@ if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") endif() +@@ -29,7 +29,7 @@ + if (NOT Z3_LIBRARIES) + message(FATAL_ERROR "z3 dependency has not been found") + endif() +- find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") ++ set(Z3_CXX_INCLUDE_DIRS Z3_INCLUDE_DIRS) + if (NOT Z3_CXX_INCLUDE_DIRS) + message(FATAL_ERROR "z3++.h has not been found") + endif() From 564733cdc2c261d3eecf7678c50bd5356f89df15 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 12:18:29 +0100 Subject: [PATCH 53/64] Update 0003-pcre-debuglib-name-2.7.patch --- recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index dd9fe431bd97a..5157e8527ead4 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -14,7 +14,7 @@ message(FATAL_ERROR "z3 dependency has not been found") endif() - find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") -+ set(Z3_CXX_INCLUDE_DIRS Z3_INCLUDE_DIRS) ++ set(Z3_CXX_INCLUDE_DIRS ${Z3_INCLUDE_DIRS}) if (NOT Z3_CXX_INCLUDE_DIRS) message(FATAL_ERROR "z3++.h has not been found") endif() From c5820560de24b0c3645a57753f792f8e89095425 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 12:36:23 +0100 Subject: [PATCH 54/64] Update 0003-pcre-debuglib-name-2.7.patch --- recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index 5157e8527ead4..f4b46641e19a3 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -14,7 +14,7 @@ message(FATAL_ERROR "z3 dependency has not been found") endif() - find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") -+ set(Z3_CXX_INCLUDE_DIRS ${Z3_INCLUDE_DIRS}) ++ set(Z3_CXX_INCLUDE_DIRS z3::libz3) if (NOT Z3_CXX_INCLUDE_DIRS) message(FATAL_ERROR "z3++.h has not been found") endif() From abd73fae37d2b1437f9257794a51c98e720163a3 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:14:46 +0100 Subject: [PATCH 55/64] Update 0003-pcre-debuglib-name-2.7.patch --- recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index f4b46641e19a3..1335f250a3c93 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -14,7 +14,7 @@ message(FATAL_ERROR "z3 dependency has not been found") endif() - find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") -+ set(Z3_CXX_INCLUDE_DIRS z3::libz3) ++ get_target_property(Z3_CXX_INCLUDE_DIRS z3::libz3 INCLUDE_DIRECTORIES) if (NOT Z3_CXX_INCLUDE_DIRS) message(FATAL_ERROR "z3++.h has not been found") endif() From 47270395d353748a464155e77004ac31ba02ba52 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 14:00:08 +0100 Subject: [PATCH 56/64] Update 0003-pcre-debuglib-name-2.7.patch --- .../patches/0003-pcre-debuglib-name-2.7.patch | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch index 1335f250a3c93..fa8b46fd1608e 100644 --- a/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch +++ b/recipes/cppcheck/all/patches/0003-pcre-debuglib-name-2.7.patch @@ -1,5 +1,5 @@ --- a/cmake/findDependencies.cmake 2022-04-15 20:23:30.000000000 +0200 -+++ b/cmake/findDependencies.cmake 2022-11-24 12:06:28.533888200 +0100 ++++ b/cmake/findDependencies.cmake 2022-11-24 13:57:22.099453500 +0100 @@ -16,7 +16,7 @@ if (HAVE_RULES) @@ -9,12 +9,20 @@ if (NOT PCRE_LIBRARY OR NOT PCRE_INCLUDE) message(FATAL_ERROR "pcre dependency for RULES has not been found") endif() -@@ -29,7 +29,7 @@ - if (NOT Z3_LIBRARIES) - message(FATAL_ERROR "z3 dependency has not been found") - endif() -- find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") -+ get_target_property(Z3_CXX_INCLUDE_DIRS z3::libz3 INCLUDE_DIRECTORIES) - if (NOT Z3_CXX_INCLUDE_DIRS) - message(FATAL_ERROR "z3++.h has not been found") - endif() +@@ -24,16 +24,8 @@ + + if (USE_Z3) + find_package(Z3 QUIET) +- if (NOT Z3_FOUND) + find_library(Z3_LIBRARIES z3) +- if (NOT Z3_LIBRARIES) +- message(FATAL_ERROR "z3 dependency has not been found") +- endif() + find_path(Z3_CXX_INCLUDE_DIRS z3++.h PATH_SUFFIXES "z3") +- if (NOT Z3_CXX_INCLUDE_DIRS) +- message(FATAL_ERROR "z3++.h has not been found") +- endif() +- endif() + endif() + + set(CMAKE_INCLUDE_CURRENT_DIR ON) From aca06fe32c512c7578234a74535a2dd4395a0cb3 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:41:00 +0100 Subject: [PATCH 57/64] Update 0003-pcre-debuglib-name-2.7.patch --- recipes/cppcheck/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index ece8abb50331f..7993fa29467da 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -47,6 +47,7 @@ def generate(self): tc.variables["HAVE_RULES"] = self.options.have_rules tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False + tc.variables["FILESDIR"] = os.path.join(self.package_folder, "bin", "cfg") tc.generate() deps = CMakeDeps(self) From a6bb28eb3840bc90a2d10e6096d4a6902ab03974 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Fri, 25 Nov 2022 09:58:20 +0100 Subject: [PATCH 58/64] Update conanfile.py --- recipes/cppcheck/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 7993fa29467da..f11ea170ff55d 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version @@ -47,7 +48,8 @@ def generate(self): tc.variables["HAVE_RULES"] = self.options.have_rules tc.variables["USE_MATCHCOMPILER"] = "Auto" tc.variables["ENABLE_OSS_FUZZ"] = False - tc.variables["FILESDIR"] = os.path.join(self.package_folder, "bin", "cfg") + if is_apple_os(self): + tc.variables["FILESDIR"] = os.path.join(self.package_folder, "bin", "cfg") tc.generate() deps = CMakeDeps(self) From 7a3131c1884c2287eeb119d17f6dccddfaf87f38 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 19:38:56 +0100 Subject: [PATCH 59/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index f11ea170ff55d..2243053a06d1f 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -5,7 +5,7 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.46.0" +required_conan_version = ">=1.52.0" class CppcheckConan(ConanFile): From e71f6d0341fd0b18bea7ae9736a338480ab62ad8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 19:39:31 +0100 Subject: [PATCH 60/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 2243053a06d1f..dbf77cd95b9ba 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -33,7 +33,7 @@ def package_id(self): del self.info.options.with_z3 def requirements(self): - if Version(self.version) < Version("2.8.0") and self.options.with_z3: + if self.options.get_safe(with_z3, False): self.requires("z3/4.8.8") if self.options.have_rules: self.requires("pcre/8.45") From bfabc97efc381aed14fdc69b22d73d2f2e5463b8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 19:39:51 +0100 Subject: [PATCH 61/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index dbf77cd95b9ba..46a9dcab3cbc6 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -76,7 +76,6 @@ def package_info(self): bin_folder = os.path.join(self.package_folder, "bin") self.output.info("Append %s to environment variable PATH" % bin_folder) self.env_info.PATH.append(bin_folder) - self.runenv_info.append_path("PATH", bin_folder) cppcheck_htmlreport = os.path.join(bin_folder, "cppcheck-htmlreport") self.env_info.CPPCHECK_HTMLREPORT = cppcheck_htmlreport self.runenv_info.define_path("CPPCHECK_HTMLREPORT", cppcheck_htmlreport) From bd6711299c6507af0f737a6e7b4e8119c86be17d Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 19:39:57 +0100 Subject: [PATCH 62/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 46a9dcab3cbc6..c9bf3f33309a1 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -56,8 +56,8 @@ def generate(self): deps.generate() def build(self): - cmake = CMake(self) apply_conandata_patches(self) + cmake = CMake(self) cmake.configure() cmake.build() From 01fa00a27eba844287a2477b9afa5c2bda2711a8 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 19:40:10 +0100 Subject: [PATCH 63/64] Update recipes/cppcheck/all/conanfile.py Co-authored-by: Chris Mc --- recipes/cppcheck/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index c9bf3f33309a1..689dd00fae158 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -43,7 +43,7 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < Version("2.8.0"): + if Version(self.version) < "2.8.0": tc.variables["USE_Z3"] = self.options.with_z3 tc.variables["HAVE_RULES"] = self.options.have_rules tc.variables["USE_MATCHCOMPILER"] = "Auto" From 3247619b0877e45a2f9afee08514bba9a0331be7 Mon Sep 17 00:00:00 2001 From: Sneder89 <45610045+Sneder89@users.noreply.github.com> Date: Sun, 27 Nov 2022 20:09:09 +0100 Subject: [PATCH 64/64] use tool_requires in test package, add required fields in conandata.yml file --- recipes/cppcheck/all/conandata.yml | 16 ++++++++++++++++ recipes/cppcheck/all/conanfile.py | 5 +---- recipes/cppcheck/all/test_package/conanfile.py | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/recipes/cppcheck/all/conandata.yml b/recipes/cppcheck/all/conandata.yml index a4208beceac96..d97f5c1a31a95 100644 --- a/recipes/cppcheck/all/conandata.yml +++ b/recipes/cppcheck/all/conandata.yml @@ -11,12 +11,28 @@ sources: patches: "2.9.2": - patch_file: "patches/0001-cli-remove-dmake-cmake.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" "2.8.2": - patch_file: "patches/0001-cli-remove-dmake-cmake-2.8.patch" + patch_description: "Remove dmake tool from target ALL" + patch_type: "portability" - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" - patch_file: "patches/0003-pcre-debuglib-name.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" "2.7.5": - patch_file: "patches/0002-htmlreport-python3.patch" + patch_description: "Use Python 3 in Shebang Header" + patch_type: "portability" - patch_file: "patches/0003-pcre-debuglib-name-2.7.patch" + patch_description: "Consider the Debug suffix for Windows" + patch_type: "portability" diff --git a/recipes/cppcheck/all/conanfile.py b/recipes/cppcheck/all/conanfile.py index 689dd00fae158..4427cdebe7d18 100644 --- a/recipes/cppcheck/all/conanfile.py +++ b/recipes/cppcheck/all/conanfile.py @@ -29,11 +29,8 @@ def config_options(self): if Version(self.version) >= Version("2.8.0"): del self.options.with_z3 - def package_id(self): - del self.info.options.with_z3 - def requirements(self): - if self.options.get_safe(with_z3, False): + if self.options.get_safe("with_z3", default=False): self.requires("z3/4.8.8") if self.options.have_rules: self.requires("pcre/8.45") diff --git a/recipes/cppcheck/all/test_package/conanfile.py b/recipes/cppcheck/all/test_package/conanfile.py index 87d97d10fc475..f29289a5751d7 100644 --- a/recipes/cppcheck/all/test_package/conanfile.py +++ b/recipes/cppcheck/all/test_package/conanfile.py @@ -8,8 +8,8 @@ class TestPackageConan(ConanFile): generators = "VirtualRunEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) + def build_requirements(self): + self.tool_requires(self.tested_reference_str) def test(self): if can_run(self):