From 9e217c13332f0da17be7344f8bc732777ac09b5c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:10:19 +0200 Subject: [PATCH 01/19] fix import of Version --- recipes/libvault/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 659305c5f732b..9535c232415c4 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -1,6 +1,6 @@ import os -from conan import ConanFile, Version +from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd @@ -8,6 +8,7 @@ from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version required_conan_version = ">=1.53.0" From 5d259fa61b03dc18910d6ab972ab1c02eb190537 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:13:10 +0200 Subject: [PATCH 02/19] use export_conandata_patches for patches --- recipes/libvault/all/conanfile.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 9535c232415c4..2e6f46c9557dd 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -6,7 +6,7 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain from conan.tools.env import VirtualBuildEnv -from conan.tools.files import apply_conandata_patches, copy, get, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -21,14 +21,23 @@ class LibvaultConan(ConanFile): description = "A C++ library for Hashicorp Vault" topics = ("vault", "libvault", "secrets", "passwords") settings = "os", "arch", "compiler", "build_type" - exports_sources = ["CMakeLists.txt", "patches/**"] - options = {"shared": [True, False], "fPIC": [True, False]} - default_options = {"shared": False, "fPIC": True} + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } @property def _mac_os_minimum_required_version(self): return "10.15" + def export_sources(self): + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC From bff612c59ee7a6a2e23bf698366c377209e267e7 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:14:11 +0200 Subject: [PATCH 03/19] remove useless VirtualBuildEnv --- recipes/libvault/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 2e6f46c9557dd..6b2141ac159e4 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -5,7 +5,6 @@ from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain -from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -97,8 +96,6 @@ def generate(self): tc.generate() tc = CMakeDeps(self) tc.generate() - tc = VirtualBuildEnv(self) - tc.generate(scope="build") def build(self): apply_conandata_patches(self) From e5ee05ebcef8e1735de666e1ca338759096c99dd Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:16:32 +0200 Subject: [PATCH 04/19] bump libcurl --- recipes/libvault/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 6b2141ac159e4..35f9f98e8655c 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -46,7 +46,7 @@ def configure(self): self.options.rm_safe("fPIC") def requirements(self): - self.requires("libcurl/7.86.0") + self.requires("libcurl/8.2.0") self.requires("catch2/3.2.0") def validate(self): From 06d3a1a83f4268174aa4882de9e292d0cc95da74 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:17:05 +0200 Subject: [PATCH 05/19] remove useless catch2 in requirements --- recipes/libvault/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 35f9f98e8655c..4d879510ecb3b 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -47,7 +47,6 @@ def configure(self): def requirements(self): self.requires("libcurl/8.2.0") - self.requires("catch2/3.2.0") def validate(self): compiler = str(self.info.settings.compiler) From cc08480a13b79797e319a41fa8924ce3f2d261a8 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:17:24 +0200 Subject: [PATCH 06/19] add package_type --- recipes/libvault/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 4d879510ecb3b..9ed68222a9fbe 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -19,6 +19,7 @@ class LibvaultConan(ConanFile): homepage = "https://github.com/abedra/libvault" description = "A C++ library for Hashicorp Vault" topics = ("vault", "libvault", "secrets", "passwords") + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], From d6e5591e975de7767c1b4e5b94087ace0f98aec1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:18:10 +0200 Subject: [PATCH 07/19] fix min Visual Studio/msvc version --- recipes/libvault/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 9ed68222a9fbe..e0a2c156220bf 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -54,7 +54,8 @@ def validate(self): compiler_version = Version(self.settings.compiler.version.value) minimum_compiler_version = { - "Visual Studio": "19", + "Visual Studio": "16", + "msvc": "192", "gcc": "8", "clang": "7.0", "apple-clang": "12", From dcdf558e6c700d767af0e1265e92f38ca3bd09f4 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:19:18 +0200 Subject: [PATCH 08/19] no self.info in validate() --- recipes/libvault/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index e0a2c156220bf..c46ca1a21a7f2 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -50,7 +50,7 @@ def requirements(self): self.requires("libcurl/8.2.0") def validate(self): - compiler = str(self.info.settings.compiler) + compiler = str(self.settings.compiler) compiler_version = Version(self.settings.compiler.version.value) minimum_compiler_version = { @@ -73,7 +73,7 @@ def validate(self): raise ConanInvalidConfiguration("clang 11 with libstdc++ is not supported due to old libstdc++ missing C++17 support") if is_apple_os(self): - os_version = self.info.settings.get_safe("os.version") + os_version = self.settings.get_safe("os.version") if os_version and Version(os_version) < self._mac_os_minimum_required_version: raise ConanInvalidConfiguration( "Macos Mojave (10.14) and earlier cannot to be built because C++ standard library too old.") From c853768c9f6379fcf7087813a7288f631f1f4b59 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:19:48 +0200 Subject: [PATCH 09/19] remove useless CMakeLists --- recipes/libvault/all/CMakeLists.txt | 7 ------- recipes/libvault/all/conanfile.py | 1 - 2 files changed, 8 deletions(-) delete mode 100644 recipes/libvault/all/CMakeLists.txt diff --git a/recipes/libvault/all/CMakeLists.txt b/recipes/libvault/all/CMakeLists.txt deleted file mode 100644 index 217b9530b904d..0000000000000 --- a/recipes/libvault/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.11) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup() - -add_subdirectory("source_subfolder") diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index c46ca1a21a7f2..f3a30fc0db5ef 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -35,7 +35,6 @@ def _mac_os_minimum_required_version(self): return "10.15" def export_sources(self): - copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) export_conandata_patches(self) def config_options(self): From 5b906cfec8fa91b3bc808018c6ef4fb11a8ff042 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:20:54 +0200 Subject: [PATCH 10/19] add a layout --- recipes/libvault/all/conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index f3a30fc0db5ef..5b9b7bd72698a 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -4,7 +4,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.build import check_min_cppstd -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -45,6 +45,9 @@ def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): self.requires("libcurl/8.2.0") @@ -100,7 +103,7 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(build_script_folder=self.build_folder) + cmake.configure() cmake.build() def package(self): From 8c058a96c5641addf735971be2cfd76ba587e1f0 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:21:34 +0200 Subject: [PATCH 11/19] add libm to system libs on Linux & FreeBSD only --- recipes/libvault/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 5b9b7bd72698a..9c973c1670e81 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -115,7 +115,8 @@ def package(self): def package_info(self): self.cpp_info.libs = ["vault"] - self.cpp_info.system_libs = ["m"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") # TODO: Remove after Conan 2.0 From a3b090868399ab3c447222121580de1d3c054308 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:22:15 +0200 Subject: [PATCH 12/19] final cleanup --- recipes/libvault/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 9c973c1670e81..f7ff906a18cee 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -97,8 +97,8 @@ def generate(self): tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() - tc = CMakeDeps(self) - tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): apply_conandata_patches(self) @@ -119,9 +119,6 @@ def package_info(self): self.cpp_info.system_libs.append("m") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version).major == "8": self.cpp_info.system_libs.append("stdc++fs") - # TODO: Remove after Conan 2.0 - self.cpp_info.names["cmake_find_package"] = "libvault" - self.cpp_info.names["cmake_find_package_multi"] = "libvault" self.cpp_info.set_property("pkg_config_name", "vault") self.cpp_info.set_property("cmake_file_name", "libvault") From 338e60e24f8c85ad3484bb939208c851605f6bae Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 30 Aug 2023 03:04:15 +0200 Subject: [PATCH 13/19] fix traits of requirements --- recipes/libvault/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index f7ff906a18cee..6eb875bf94911 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -49,7 +49,8 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("libcurl/8.2.0") + # public header VaultClient.h includes curl/curl.h and use several functions + self.requires("libcurl/8.2.0", transitive_headers=True, transitive_libs=True) def validate(self): compiler = str(self.settings.compiler) From 760afa653089d47e16b59897ac671cd14662075d Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 30 Aug 2023 03:21:14 +0200 Subject: [PATCH 14/19] cleanup --- recipes/libvault/all/conanfile.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 6eb875bf94911..16ce0850a379d 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -6,10 +6,9 @@ from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir -from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.54.0" class LibvaultConan(ConanFile): @@ -85,18 +84,15 @@ def validate(self): check_min_cppstd(self, minimum_cpp_standard) def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) - tc.variables["ENABLE_TEST"] = "OFF" - tc.variables["ENABLE_INTEGRATION_TEST"] = "OFF" - tc.variables["ENABLE_COVERAGE"] = "OFF" - tc.variables["LINK_CURL"] = "OFF" + tc.variables["ENABLE_TEST"] = False + tc.variables["ENABLE_INTEGRATION_TEST"] = False + tc.variables["ENABLE_COVERAGE"] = False + tc.variables["LINK_CURL"] = False tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version - if is_msvc(self): - tc.variables["USE_MSVC_RUNTIME_LIBRARY_DLL"] = not is_msvc_static_runtime(self) - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() deps = CMakeDeps(self) deps.generate() From ddf48cda8292047514cfd92aec530a680674fa2c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 30 Aug 2023 03:22:41 +0200 Subject: [PATCH 15/19] do not manually set CMAKE_OSX_DEPLOYMENT_TARGET it's already handled by CMakeToolchain --- recipes/libvault/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 16ce0850a379d..2e8eb68816042 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -92,7 +92,6 @@ def generate(self): tc.variables["ENABLE_INTEGRATION_TEST"] = False tc.variables["ENABLE_COVERAGE"] = False tc.variables["LINK_CURL"] = False - tc.variables["CMAKE_OSX_DEPLOYMENT_TARGET"] = self._mac_os_minimum_required_version tc.generate() deps = CMakeDeps(self) deps.generate() From 596c9d63e3beace312756e70a9ad2221ba79f042 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sat, 2 Sep 2023 22:29:47 +0200 Subject: [PATCH 16/19] bump libcurl --- recipes/libvault/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index 2e8eb68816042..eb1ddad09594d 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): # public header VaultClient.h includes curl/curl.h and use several functions - self.requires("libcurl/8.2.0", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/8.2.1", transitive_headers=True, transitive_libs=True) def validate(self): compiler = str(self.settings.compiler) From 6d0ab50a23638daef6f32219ef4728b44e5ee1cd Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:55:16 +0200 Subject: [PATCH 17/19] use version range for libcurl --- recipes/libvault/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index eb1ddad09594d..a45e677ae48ce 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -49,7 +49,7 @@ def layout(self): def requirements(self): # public header VaultClient.h includes curl/curl.h and use several functions - self.requires("libcurl/8.2.1", transitive_headers=True, transitive_libs=True) + self.requires("libcurl/[>=7.78.0 <9]", transitive_headers=True, transitive_libs=True) def validate(self): compiler = str(self.settings.compiler) From 5c488beddc8608c962711ddede3ce107de1730fe Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Sun, 17 Sep 2023 23:59:03 +0200 Subject: [PATCH 18/19] fix dll name to avoid conflict with Vault.dll system lib on Windows --- recipes/libvault/all/conanfile.py | 1 - .../all/patches/fix-cmake-0.48.0.patch | 69 +++++++------------ .../all/patches/fix-cmake-0.51.0.patch | 56 +++++++-------- 3 files changed, 48 insertions(+), 78 deletions(-) diff --git a/recipes/libvault/all/conanfile.py b/recipes/libvault/all/conanfile.py index a45e677ae48ce..408c16f6dbb3b 100644 --- a/recipes/libvault/all/conanfile.py +++ b/recipes/libvault/all/conanfile.py @@ -91,7 +91,6 @@ def generate(self): tc.variables["ENABLE_TEST"] = False tc.variables["ENABLE_INTEGRATION_TEST"] = False tc.variables["ENABLE_COVERAGE"] = False - tc.variables["LINK_CURL"] = False tc.generate() deps = CMakeDeps(self) deps.generate() diff --git a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch b/recipes/libvault/all/patches/fix-cmake-0.48.0.patch index 510090973c349..df2816ee6d88d 100644 --- a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch +++ b/recipes/libvault/all/patches/fix-cmake-0.48.0.patch @@ -1,63 +1,42 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -4,7 +4,6 @@ - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - set(CMAKE_CXX_EXTENSIONS OFF) +@@ -1,10 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.48.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_FLAGS_DEBUG --coverage) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - + option(ENABLE_TEST "Enable tests?" ON) -@@ -14,13 +13,6 @@ +@@ -14,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) option(INSTALL "Run install targets" ON) - + -find_package(CURL) -if (CURL_FOUND) - include_directories(${CURL_INCLUDE_DIR}) -else (CURL_FOUND) - message(FATAL_ERROR "CURL not found") -endif (CURL_FOUND) -- ++find_package(CURL REQUIRED) + include(GNUInstallDirs) include_directories("${PROJECT_SOURCE_DIR}/lib") - -@@ -120,11 +112,20 @@ - +@@ -120,9 +111,11 @@ set_target_properties(vault PROPERTIES + target_include_directories(vault PRIVATE src) - -+OPTION(UseCurl "UseCurl" ON) -+IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ target_link_libraries(vault CURL::libcurl) -+ ENDIF() -+ENDIF() -+ - if(LINK_CURL) - target_link_libraries(vault curl) - endif(LINK_CURL) - + +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + if (ENABLE_COVERAGE) -+ set(CMAKE_CXX_FLAGS_DEBUG --coverage) target_link_libraries(vault gcov) - endif () - -@@ -155,7 +156,7 @@ - "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") - -- configure_file(vault.pc.in vault.pc @ONLY) -+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_BINARY_DIR}/vault.pc" @ONLY) - install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif (INSTALL) -@@ -176,7 +177,7 @@ - target_include_directories(libvault_test PRIVATE include) - - target_link_libraries(libvault_test vault) -- target_link_libraries(libvault_test curl) -+ target_link_libraries(libvault_test CURL::libcurl) - target_link_libraries(libvault_test Catch2::Catch2) - - include(CTest) diff --git a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch b/recipes/libvault/all/patches/fix-cmake-0.51.0.patch index 74ce9e72d06db..2ff417c356ac8 100644 --- a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch +++ b/recipes/libvault/all/patches/fix-cmake-0.51.0.patch @@ -1,6 +1,16 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -13,13 +13,6 @@ option(LINK_CURL "Link curl library for vault" OFF) +@@ -1,9 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.51.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + option(ENABLE_TEST "Enable tests?" ON) +@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) option(INSTALL "Run install targets" ON) @@ -10,40 +20,22 @@ -else (CURL_FOUND) - message(FATAL_ERROR "CURL not found") -endif (CURL_FOUND) -- ++find_package(CURL REQUIRED) + include(GNUInstallDirs) include_directories("${PROJECT_SOURCE_DIR}/lib") - -@@ -119,6 +112,14 @@ set_target_properties(vault PROPERTIES +@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES target_include_directories(vault PRIVATE src) -+OPTION(UseCurl "UseCurl" ON) -+IF (UseCurl) -+ FIND_PACKAGE(CURL) -+ IF (CURL_FOUND) -+ target_link_libraries(vault CURL::libcurl) -+ ENDIF() -+ENDIF() -+ - if(LINK_CURL) - target_link_libraries(vault curl) - endif(LINK_CURL) -@@ -155,7 +156,7 @@ if (INSTALL) - "${CMAKE_CURRENT_BINARY_DIR}/libvaultConfigVersion.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/libvault") - -- configure_file(vault.pc.in vault.pc @ONLY) -+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/vault.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/vault.pc" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - endif (INSTALL) -@@ -176,7 +177,7 @@ if (ENABLE_TEST) - target_include_directories(libvault_test PRIVATE include) - - target_link_libraries(libvault_test vault) -- target_link_libraries(libvault_test curl) -+ target_link_libraries(libvault_test CURL::libcurl) - target_link_libraries(libvault_test Catch2::Catch2) - target_link_libraries(libvault_test stdc++fs) +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + if (ENABLE_COVERAGE) + target_link_libraries(vault gcov) From 316651ca1f788e24dafaf71a18ed62b653bf93c3 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 18 Sep 2023 01:19:51 +0200 Subject: [PATCH 19/19] fix patch for 0.52.0 --- recipes/libvault/all/conandata.yml | 6 +-- ...48.0.patch => 0.48.0-0001-fix-cmake.patch} | 0 ...51.0.patch => 0.51.0-0001-fix-cmake.patch} | 0 .../all/patches/0.52.0-0001-fix-cmake.patch | 41 +++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) rename recipes/libvault/all/patches/{fix-cmake-0.48.0.patch => 0.48.0-0001-fix-cmake.patch} (100%) rename recipes/libvault/all/patches/{fix-cmake-0.51.0.patch => 0.51.0-0001-fix-cmake.patch} (100%) create mode 100644 recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch diff --git a/recipes/libvault/all/conandata.yml b/recipes/libvault/all/conandata.yml index c828fc89b0560..fad4071cba2ec 100644 --- a/recipes/libvault/all/conandata.yml +++ b/recipes/libvault/all/conandata.yml @@ -10,14 +10,14 @@ sources: sha256: 0a42be282ff0aff77b68cb7238014aa762df5c6b62e4d3561878874ca3760489 patches: "0.52.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" + - patch_file: "patches/0.52.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" "0.51.0": - - patch_file: "patches/fix-cmake-0.51.0.patch" + - patch_file: "patches/0.51.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" "0.48.0": - - patch_file: "patches/fix-cmake-0.48.0.patch" + - patch_file: "patches/0.48.0-0001-fix-cmake.patch" patch_type: "conan" patch_description: "use libcurl from conan center" diff --git a/recipes/libvault/all/patches/fix-cmake-0.48.0.patch b/recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch similarity index 100% rename from recipes/libvault/all/patches/fix-cmake-0.48.0.patch rename to recipes/libvault/all/patches/0.48.0-0001-fix-cmake.patch diff --git a/recipes/libvault/all/patches/fix-cmake-0.51.0.patch b/recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch similarity index 100% rename from recipes/libvault/all/patches/fix-cmake-0.51.0.patch rename to recipes/libvault/all/patches/0.51.0-0001-fix-cmake.patch diff --git a/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch b/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch new file mode 100644 index 0000000000000..70b3ab582fcdc --- /dev/null +++ b/recipes/libvault/all/patches/0.52.0-0001-fix-cmake.patch @@ -0,0 +1,41 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,9 +1,6 @@ + cmake_minimum_required(VERSION 3.12) + project(vault VERSION 0.52.0 DESCRIPTION "Vault library for C++") + +-set(CMAKE_CXX_STANDARD 17) +-set(CMAKE_CXX_STANDARD_REQUIRED ON) +-set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + option(ENABLE_TEST "Enable tests?" ON) +@@ -13,12 +10,7 @@ option(LINK_CURL "Link curl library for vault" OFF) + option(BUILD_SHARED_LIBS "Build vault as a shared library" ON) + option(INSTALL "Run install targets" ON) + +-find_package(CURL) +-if (CURL_FOUND) +- include_directories(${CURL_INCLUDE_DIR}) +-else (CURL_FOUND) +- message(FATAL_ERROR "CURL not found") +-endif (CURL_FOUND) ++find_package(CURL REQUIRED) + + include(GNUInstallDirs) + include_directories("${PROJECT_SOURCE_DIR}/lib") +@@ -119,9 +111,11 @@ set_target_properties(vault PROPERTIES + + target_include_directories(vault PRIVATE src) + +-if(LINK_CURL) +- target_link_libraries(vault curl) +-endif(LINK_CURL) ++target_link_libraries(vault PUBLIC CURL::libcurl) ++target_compile_features(vault PUBLIC cxx_std_17) ++if(WIN32) ++ set_target_properties(vault PROPERTIES RUNTIME_OUTPUT_NAME "VaultClient") ++endif() + + if (ENABLE_COVERAGE) + target_link_libraries(vault gcov)