From 7cac22fd8e5d862db292038798e6d6c974660621 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 9 May 2022 20:05:27 +0200 Subject: [PATCH] (#10665) vcglib: add 2022.02 + modernize * modernize * bump eigen * add vcglib/2022.02 --- recipes/vcglib/all/CMakeLists.txt | 2 +- recipes/vcglib/all/conandata.yml | 6 ++++++ recipes/vcglib/all/conanfile.py | 21 +++++++++++-------- .../vcglib/all/test_package/CMakeLists.txt | 6 ++++-- recipes/vcglib/all/test_package/conanfile.py | 4 ++-- recipes/vcglib/config.yml | 2 ++ 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/recipes/vcglib/all/CMakeLists.txt b/recipes/vcglib/all/CMakeLists.txt index ac660af298764..8c109eb5cb52f 100644 --- a/recipes/vcglib/all/CMakeLists.txt +++ b/recipes/vcglib/all/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8) project(vcglib) include(conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(KEEP_RPATHS) set(VCGLIB_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source_subfolder) diff --git a/recipes/vcglib/all/conandata.yml b/recipes/vcglib/all/conandata.yml index c8cca80b2b1c4..9189efc74ad1c 100644 --- a/recipes/vcglib/all/conandata.yml +++ b/recipes/vcglib/all/conandata.yml @@ -1,8 +1,14 @@ sources: + "2022.02": + url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2022.02.tar.gz" + sha256: "724f5ef6ab9b9d21ff2e9e965c2ce909cc024b29f2aa7d39e2974b28ff25bc3f" "2020.12": url: "https://github.com/cnr-isti-vclab/vcglib/archive/refs/tags/2020.12.tar.gz" sha256: "731c57435e39c4b958a1d766cadd9865d9db35e36410708f2da7818e9fa5f786" patches: + "2022.02": + - patch_file: "patches/0001-use-external-eigen.patch" + base_path: "source_subfolder" "2020.12": - patch_file: "patches/0001-use-external-eigen.patch" base_path: "source_subfolder" diff --git a/recipes/vcglib/all/conanfile.py b/recipes/vcglib/all/conanfile.py index 2cc49f74a7808..fdb554f64e62d 100644 --- a/recipes/vcglib/all/conanfile.py +++ b/recipes/vcglib/all/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, CMake, tools +import functools required_conan_version = ">=1.33.0" @@ -7,7 +8,7 @@ class VcglibConan(ConanFile): name = "vcglib" description = "Library for manipulation, processing, cleaning, simplifying triangle meshes." license = "GPL-3.0-only" - topics = ("conan", "vcglib", "mesh-processing") + topics = ("vcglib", "mesh-processing") homepage = "https://github.com/cnr-isti-vclab/vcglib" url = "https://github.com/conan-io/conan-center-index" @@ -21,14 +22,17 @@ class VcglibConan(ConanFile): "fPIC": True, } - exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake", "cmake_find_package_multi" - _cmake = None @property def _source_subfolder(self): return "source_subfolder" + def export_sources(self): + self.copy("CMakeLists.txt") + for patch in self.conan_data.get("patches", {}).get(self.version, []): + self.copy(patch["patch_file"]) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -38,7 +42,7 @@ def configure(self): del self.options.fPIC def requirements(self): - self.requires("eigen/3.3.9") + self.requires("eigen/3.4.0") def validate(self): if self.settings.compiler.get_safe("cppstd"): @@ -48,12 +52,11 @@ def source(self): tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) + @functools.lru_cache(1) def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.configure() - return self._cmake + cmake = CMake(self) + cmake.configure() + return cmake def build(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): diff --git a/recipes/vcglib/all/test_package/CMakeLists.txt b/recipes/vcglib/all/test_package/CMakeLists.txt index 33ae887aa6aea..2f5ac307877bf 100644 --- a/recipes/vcglib/all/test_package/CMakeLists.txt +++ b/recipes/vcglib/all/test_package/CMakeLists.txt @@ -2,8 +2,10 @@ cmake_minimum_required(VERSION 3.1) project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +conan_basic_setup(TARGETS) + +find_package(vcglib REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} vcglib::vcglib) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) diff --git a/recipes/vcglib/all/test_package/conanfile.py b/recipes/vcglib/all/test_package/conanfile.py index bdac6857c5271..8eaf28f5cf632 100644 --- a/recipes/vcglib/all/test_package/conanfile.py +++ b/recipes/vcglib/all/test_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "cmake" + generators = "cmake", "cmake_find_package_multi" def build(self): cmake = CMake(self) @@ -12,7 +12,7 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self.settings): + if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") obj_path = os.path.join(self.source_folder, "cube.obj") self.run("{} {}".format(bin_path, obj_path), run_environment=True) diff --git a/recipes/vcglib/config.yml b/recipes/vcglib/config.yml index 39fde63dbe75b..8fa4c473789d6 100644 --- a/recipes/vcglib/config.yml +++ b/recipes/vcglib/config.yml @@ -1,3 +1,5 @@ versions: + "2022.02": + folder: all "2020.12": folder: all