From e06c337a16d044fd1cd6f8c7acac32f390e2bdad Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Dec 2022 14:01:07 +0100 Subject: [PATCH 01/21] Add version 3.0.6 Signed-off-by: Uilian Ries --- recipes/jasper/all/conandata.yml | 40 +---- recipes/jasper/all/conanfile.py | 79 ++++----- .../all/patches/fix-exported-symbols.patch | 163 ------------------ .../jasper/all/test_package/CMakeLists.txt | 13 +- recipes/jasper/all/test_package/conanfile.py | 21 ++- .../jasper/all/test_v1_package/CMakeLists.txt | 10 ++ .../jasper/all/test_v1_package/conanfile.py | 17 ++ .../jasper/all/test_v1_package/test_package.c | 43 +++++ recipes/jasper/config.yml | 23 +-- 9 files changed, 123 insertions(+), 286 deletions(-) delete mode 100644 recipes/jasper/all/patches/fix-exported-symbols.patch create mode 100644 recipes/jasper/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/jasper/all/test_v1_package/conanfile.py create mode 100644 recipes/jasper/all/test_v1_package/test_package.c diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 6867be2627152..e38c73c8afae2 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.6": + url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-3.0.6.tar.gz" + sha256: "c79961bc00158f5b5dc5f5fcfa792fde9bebb024432689d0f9e3f95a097d0ec3" "2.0.33": url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-2.0.33.tar.gz" sha256: "38b8f74565ee9e7fec44657e69adb5c9b2a966ca5947ced5717cde18a7d2eca6" @@ -8,40 +11,3 @@ sources: "2.0.28": url: "https://github.com/jasper-software/jasper/archive/version-2.0.28.tar.gz" sha256: "6b4e5f682be0ab1a5acb0eeb6bf41d6ce17a658bb8e2dbda95de40100939cc88" - "2.0.27": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.27.tar.gz" - sha256: "df41bd015a9dd0cc2a2e696f8ca5cbfb633323ca9429621f7fa801778681f2dd" - "2.0.26": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.26.tar.gz" - sha256: "a82a119e85b7d1f448e61309777fa5f79053a9adca4a2b5bfe44be5439fb8fea" - "2.0.25": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.25.tar.gz" - sha256: "f5bc48e2884bcabd2aca1737baff4ca962ec665b6eb673966ced1f7adea07edb" - "2.0.24": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.24.tar.gz" - sha256: "d2d28e115968d38499163cf8086179503668ce0d71b90dd33855b3de96a1ca1d" - "2.0.23": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.23.tar.gz" - sha256: "20facc904bd9d38c20e0c090b1be3ae02ae5b2703b803013be2ecad586a18927" - "2.0.22": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.22.tar.gz" - sha256: "afc4166bff29b8a0dc46ed5e8d6a208d7976fccfd0b1146e3400c8b2948794a2" - "2.0.21": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.21.tar.gz" - sha256: "2482def06dfaa33b8d93cbe992a29723309f3c2b6e75674423a52fc82be10418" - "2.0.19": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.19.tar.gz" - sha256: "b9d16162a088617ada36450f2374d72165377cb64b33ed197c200bcfb73ec76c" - "2.0.16": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.16.tar.gz" - sha256: "f1d8b90f231184d99968f361884e2054a1714fdbbd9944ba1ae4ebdcc9bbfdb1" - "2.0.14": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.14.tar.gz" - sha256: "85266eea728f8b14365db9eaf1edc7be4c348704e562bb05095b9a077cf1a97b" -patches: - "2.0.16": - - patch_file: "patches/fix-exported-symbols.patch" - base_path: "source_subfolder" - "2.0.14": - - patch_file: "patches/fix-exported-symbols.patch" - base_path: "source_subfolder" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 796bf127244db..8757a5e941890 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,12 +1,10 @@ -from conans import CMake from conan import ConanFile -from conan.tools.files import get, save, rmdir, rm, replace_in_file, apply_conandata_patches, export_conandata_patches -from conan.tools.scm import Version -from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import get, replace_in_file, copy, rmdir, rm, save import os import textwrap -required_conan_version = ">=1.53.0" +required_conan_version = ">=1.50.0" class JasperConan(ConanFile): @@ -16,7 +14,6 @@ class JasperConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" topics = ("tool-kit", "coding") description = "JasPer Image Processing/Coding Tool Kit" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -29,20 +26,8 @@ class JasperConan(ConanFile): "with_libjpeg": "libjpeg", } - generators = "cmake", "cmake_find_package" - _cmake = None - - @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _build_subfolder(self): - return "build_subfolder" - def export_sources(self): self.copy("CMakeLists.txt") - export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -54,36 +39,33 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + def layout(self): + cmake_layout(self, src_folder="src") + def requirements(self): if self.options.with_libjpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.2") + self.requires("libjpeg-turbo/2.1.4") elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") - def validate(self): - if self.settings.compiler == "Visual Studio" and Version(self.settings.compiler.version) == "16": - raise ConanInvalidConfiguration(f"{self.name} Current can not build in CCI due to windows SDK version. See https://github.com/conan-io/conan-center-index/pull/13285 for the solution hopefully") - def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self._source_subfolder, strip_root=True) - - def _configure_cmake(self): - if self._cmake: - return self._cmake - self._cmake = CMake(self) - self._cmake.definitions["JAS_ENABLE_DOC"] = False - self._cmake.definitions["JAS_ENABLE_PROGRAMS"] = False - self._cmake.definitions["JAS_ENABLE_SHARED"] = self.options.shared - self._cmake.definitions["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" - self._cmake.definitions["JAS_ENABLE_OPENGL"] = False - self._cmake.configure(build_folder=self._build_subfolder) - return self._cmake + destination=self.source_folder, strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["JAS_ENABLE_DOC"] = False + tc.variables["JAS_ENABLE_PROGRAMS"] = False + tc.variables["JAS_ENABLE_SHARED"] = self.options.shared + tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" + tc.variables["JAS_ENABLE_OPENGL"] = False + tc.generate() + tc = CMakeDeps(self) + tc.generate() def _patch_sources(self): - apply_conandata_patches(self) - # Clean rpath in installed shared lib - cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + # INFO: Clean rpath in installed shared lib + cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") cmds_to_remove = [ "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/lib\")", "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", @@ -93,24 +75,26 @@ def _patch_sources(self): replace_in_file(self, cmakelists, cmd_to_remove, "") def build(self): - self._patch_sources() - cmake = self._configure_cmake() + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") - cmake = self._configure_cmake() + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.settings.os == "Windows": for dll_prefix in ["concrt", "msvcp", "vcruntime"]: - rm(self, f"{dll_prefix}*.dll", os.path.join(self.package_folder, "bin")) - self._create_cmake_module_variables( + rm(self, "{}*.dll".format(dll_prefix), os.path.join(self.package_folder, "bin")) + self._create_cmake_module_variables(self, os.path.join(self.package_folder, self._module_file_rel_path) ) - def _create_cmake_module_variables(self, module_file): + @staticmethod + def _create_cmake_module_variables(conanfile, module_file): content = textwrap.dedent("""\ if(DEFINED Jasper_FOUND) set(JASPER_FOUND ${Jasper_FOUND}) @@ -125,14 +109,13 @@ def _create_cmake_module_variables(self, module_file): set(JASPER_VERSION_STRING ${Jasper_VERSION}) endif() """) - save(self, module_file, content) + save(conanfile, module_file, content) @property def _module_file_rel_path(self): return os.path.join("lib", "cmake", "conan-official-{}-variables.cmake".format(self.name)) def package_info(self): - self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "Jasper") self.cpp_info.set_property("cmake_target_name", "Jasper::Jasper") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) diff --git a/recipes/jasper/all/patches/fix-exported-symbols.patch b/recipes/jasper/all/patches/fix-exported-symbols.patch deleted file mode 100644 index 9db2d08488cee..0000000000000 --- a/recipes/jasper/all/patches/fix-exported-symbols.patch +++ /dev/null @@ -1,163 +0,0 @@ ---- a/src/libjasper/include/jasper/jas_cm.h -+++ b/src/libjasper/include/jasper/jas_cm.h -@@ -237,13 +237,13 @@ int jas_cm_prof_setattr(jas_cm_prof_t *prof, jas_cm_attrname_t name, void *val); - void *jas_cm_prof_getattr(jas_cm_prof_t *prof, jas_cm_attrname_t name); - #endif - --jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof, -+JAS_DLLEXPORT jas_cmxform_t *jas_cmxform_create(jas_cmprof_t *inprof, jas_cmprof_t *outprof, - jas_cmprof_t *proofprof, int op, int intent, int optimize); - --void jas_cmxform_destroy(jas_cmxform_t *xform); -+JAS_DLLEXPORT void jas_cmxform_destroy(jas_cmxform_t *xform); - - /* Apply a transform to data. */ --int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, -+JAS_DLLEXPORT int jas_cmxform_apply(jas_cmxform_t *xform, jas_cmpixmap_t *in, - jas_cmpixmap_t *out); - - int jas_cxform_optimize(jas_cmxform_t *xform, int optimize); ---- a/src/libjasper/include/jasper/jas_debug.h -+++ b/src/libjasper/include/jasper/jas_debug.h -@@ -107,10 +107,10 @@ JAS_DLLEXPORT int jas_setdbglevel(int dbglevel); - JAS_DLLEXPORT int jas_eprintf(const char *fmt, ...); - - /* Dump memory to a stream. */ --int jas_memdump(FILE *out, void *data, size_t len); -+JAS_DLLEXPORT int jas_memdump(FILE *out, void *data, size_t len); - - /* Warn about use of deprecated functionality. */ --void jas_deprecated(const char *s); -+JAS_DLLEXPORT void jas_deprecated(const char *s); - - /* Convert to a string literal */ - #define JAS_STRINGIFY(x) #x ---- a/src/libjasper/include/jasper/jas_icc.h -+++ b/src/libjasper/include/jasper/jas_icc.h -@@ -395,10 +395,10 @@ JAS_DLLEXPORT jas_iccattrval_t *jas_iccattrval_create(jas_iccuint32_t type); - - JAS_DLLEXPORT void jas_iccattrtab_dump(jas_iccattrtab_t *attrtab, FILE *out); - --extern jas_uchar jas_iccprofdata_srgb[]; --extern int jas_iccprofdata_srgblen; --extern jas_uchar jas_iccprofdata_sgray[]; --extern int jas_iccprofdata_sgraylen; -+JAS_DLLEXPORT extern jas_uchar jas_iccprofdata_srgb[]; -+JAS_DLLEXPORT extern int jas_iccprofdata_srgblen; -+JAS_DLLEXPORT extern jas_uchar jas_iccprofdata_sgray[]; -+JAS_DLLEXPORT extern int jas_iccprofdata_sgraylen; - JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfrombuf(jas_uchar *buf, int len); - JAS_DLLEXPORT jas_iccprof_t *jas_iccprof_createfromclrspc(int clrspc); - ---- a/src/libjasper/include/jasper/jas_image.h -+++ b/src/libjasper/include/jasper/jas_image.h -@@ -492,21 +492,21 @@ JAS_DLLEXPORT int jas_image_getfmt(jas_stream_t *in); - - - #define jas_image_cmprof(image) ((image)->cmprof_) --int jas_image_ishomosamp(jas_image_t *image); --int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno, -+JAS_DLLEXPORT int jas_image_ishomosamp(jas_image_t *image); -+JAS_DLLEXPORT int jas_image_sampcmpt(jas_image_t *image, int cmptno, int newcmptno, - jas_image_coord_t ho, jas_image_coord_t vo, jas_image_coord_t hs, - jas_image_coord_t vs, int sgnd, int prec); --int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, -+JAS_DLLEXPORT int jas_image_writecmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, - jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, - long *buf); --int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, -+JAS_DLLEXPORT int jas_image_readcmpt2(jas_image_t *image, int cmptno, jas_image_coord_t x, - jas_image_coord_t y, jas_image_coord_t width, jas_image_coord_t height, - long *buf); - - #define jas_image_setcmprof(image, cmprof) ((image)->cmprof_ = cmprof) - JAS_DLLEXPORT jas_image_t *jas_image_chclrspc(jas_image_t *image, jas_cmprof_t *outprof, - int intent); --void jas_image_dump(jas_image_t *image, FILE *out); -+JAS_DLLEXPORT void jas_image_dump(jas_image_t *image, FILE *out); - - /******************************************************************************\ - * Image format-dependent operations. -@@ -514,58 +514,58 @@ void jas_image_dump(jas_image_t *image, FILE *out); - - #if !defined(EXCLUDE_JPG_SUPPORT) - /* Format-dependent operations for JPG support. */ --jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr); --int jpg_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jpg_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jpg_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jpg_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jpg_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_MIF_SUPPORT) - /* Format-dependent operations for MIF support. */ --jas_image_t *mif_decode(jas_stream_t *in, const char *optstr); --int mif_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int mif_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *mif_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int mif_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int mif_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_PNM_SUPPORT) - /* Format-dependent operations for PNM support. */ --jas_image_t *pnm_decode(jas_stream_t *in, const char *optstr); --int pnm_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int pnm_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *pnm_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int pnm_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int pnm_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_RAS_SUPPORT) - /* Format-dependent operations for Sun Rasterfile support. */ --jas_image_t *ras_decode(jas_stream_t *in, const char *optstr); --int ras_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int ras_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *ras_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int ras_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int ras_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_BMP_SUPPORT) - /* Format-dependent operations for BMP support. */ --jas_image_t *bmp_decode(jas_stream_t *in, const char *optstr); --int bmp_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int bmp_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *bmp_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int bmp_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int bmp_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_JP2_SUPPORT) - /* Format-dependent operations for JP2 support. */ --jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr); --int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jp2_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jp2_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_JPC_SUPPORT) - /* Format-dependent operations for JPEG-2000 code stream support. */ --jas_image_t *jpc_decode(jas_stream_t *in, const char *optstr); --int jpc_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int jpc_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *jpc_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int jpc_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int jpc_validate(jas_stream_t *in); - #endif - - #if !defined(EXCLUDE_PGX_SUPPORT) - /* Format-dependent operations for PGX support. */ --jas_image_t *pgx_decode(jas_stream_t *in, const char *optstr); --int pgx_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); --int pgx_validate(jas_stream_t *in); -+JAS_DLLEXPORT jas_image_t *pgx_decode(jas_stream_t *in, const char *optstr); -+JAS_DLLEXPORT int pgx_encode(jas_image_t *image, jas_stream_t *out, const char *optstr); -+JAS_DLLEXPORT int pgx_validate(jas_stream_t *in); - #endif - - #ifdef __cplusplus diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index bee826cf5aec0..c8441e449dd36 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -1,16 +1,7 @@ cmake_minimum_required(VERSION 3.1) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -find_package(Jasper REQUIRED) - -message("JASPER_FOUND: ${JASPER_FOUND}") -message("JASPER_INCLUDE_DIR: ${JASPER_INCLUDE_DIR}") -message("JASPER_LIBRARIES: ${JASPER_LIBRARIES}") -message("JASPER_VERSION_STRING: ${JASPER_VERSION_STRING}") +find_package(Jasper REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.c) -target_include_directories(${PROJECT_NAME} PRIVATE ${JASPER_INCLUDE_DIR}) -target_link_libraries(${PROJECT_NAME} ${JASPER_LIBRARIES}) +target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_package/conanfile.py b/recipes/jasper/all/test_package/conanfile.py index 3da371b660e0a..a9fb96656f203 100644 --- a/recipes/jasper/all/test_package/conanfile.py +++ b/recipes/jasper/all/test_package/conanfile.py @@ -1,10 +1,19 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +21,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..98193eb228a7f --- /dev/null +++ b/recipes/jasper/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(Jasper REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_v1_package/conanfile.py b/recipes/jasper/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..49a3a66ea5bad --- /dev/null +++ b/recipes/jasper/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/jasper/all/test_v1_package/test_package.c b/recipes/jasper/all/test_v1_package/test_package.c new file mode 100644 index 0000000000000..1391fde1806e7 --- /dev/null +++ b/recipes/jasper/all/test_v1_package/test_package.c @@ -0,0 +1,43 @@ +#include + +#include + +int main(int argc, char **argv) +{ + int i; + jas_tmr_t tmr; + jas_tmr_t dummytmr; + double t; + int numiters; + + numiters = 2; + + jas_tmr_start(&tmr); + for (i = numiters; i > 0; --i) { + jas_tmr_start(&dummytmr); + } + jas_tmr_stop(&tmr); + t = jas_tmr_get(&tmr); + t /= numiters; + printf("jas_tmr_start %.3f us\n", t * 1e6); + + jas_tmr_start(&tmr); + for (i = numiters; i > 0; --i) { + jas_tmr_stop(&dummytmr); + } + jas_tmr_stop(&tmr); + t = jas_tmr_get(&tmr); + t /= numiters; + printf("jas_tmr_stop %.3f us\n", t * 1e6); + + t = 0; + for (i = numiters; i > 0; --i) { + jas_tmr_start(&tmr); + jas_tmr_stop(&tmr); + t += jas_tmr_get(&tmr); + } + t /= numiters; + printf("zero time %.3f us\n", t * 1e6); + + return 0; +} diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 61123bdc2e508..8f51268ece519 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -1,27 +1,8 @@ versions: + "3.0.6": + folder: all "2.0.33": folder: all "2.0.32": folder: all "2.0.28": - folder: all - "2.0.27": - folder: all - "2.0.26": - folder: all - "2.0.25": - folder: all - "2.0.24": - folder: all - "2.0.23": - folder: all - "2.0.22": - folder: all - "2.0.21": - folder: all - "2.0.19": - folder: all - "2.0.16": - folder: all - "2.0.14": - folder: all From 2dd37ad8e82e235064623f4ffbf3f6b63a42f9d0 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 3 Oct 2022 17:31:38 +0200 Subject: [PATCH 02/21] Remove cmake file Signed-off-by: Uilian Ries --- recipes/jasper/all/CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 recipes/jasper/all/CMakeLists.txt diff --git a/recipes/jasper/all/CMakeLists.txt b/recipes/jasper/all/CMakeLists.txt deleted file mode 100644 index daed229fb32e0..0000000000000 --- a/recipes/jasper/all/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - -set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/source_subfolder/build/cmake/modules ${CMAKE_MODULE_PATH}) - -add_subdirectory(source_subfolder) From b2b4efcdbc984d299dcd8f0d581ddff45aa4e884 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 3 Oct 2022 18:51:46 +0200 Subject: [PATCH 03/21] missing folder Signed-off-by: Uilian Ries --- recipes/jasper/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 8f51268ece519..94f80061ac6c4 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -6,3 +6,4 @@ versions: "2.0.32": folder: all "2.0.28": + folder: all From eb9d1dc1ef49c9019053a98731bcd628914c52f1 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Dec 2022 14:01:39 +0100 Subject: [PATCH 04/21] Fixes jasper 3.0.6 Signed-off-by: Uilian Ries --- recipes/jasper/all/conandata.yml | 8 +++++++ recipes/jasper/all/conanfile.py | 9 +++---- .../all/patches/3.0.6-0001-skip-rpath.patch | 24 +++++++++++++++++++ .../all/patches/3.0.6-0002-find-libjpeg.patch | 18 ++++++++++++++ 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index e38c73c8afae2..997c73aedbdc1 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -11,3 +11,11 @@ sources: "2.0.28": url: "https://github.com/jasper-software/jasper/archive/version-2.0.28.tar.gz" sha256: "6b4e5f682be0ab1a5acb0eeb6bf41d6ce17a658bb8e2dbda95de40100939cc88" +patches: + "3.0.6": + - patch_file: "patches/3.0.6-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_type: "conan" + - patch_file: "patches/3.0.6-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens" + patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 8757a5e941890..dd20af87cbb7f 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, replace_in_file, copy, rmdir, rm, save +from conan.tools.files import get, replace_in_file, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches import os import textwrap @@ -27,7 +27,7 @@ class JasperConan(ConanFile): } def export_sources(self): - self.copy("CMakeLists.txt") + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -75,13 +75,14 @@ def _patch_sources(self): replace_in_file(self, cmakelists, cmd_to_remove, "") def build(self): + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() def package(self): - copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) - copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "LICENSE*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + copy(self, "COPYRIGHT*", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) cmake = CMake(self) cmake.install() rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch new file mode 100644 index 0000000000000..959d169bd49ad --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5cf594c..a0d253d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -740,19 +740,15 @@ if(JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if(isSystemDir EQUAL -1) +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif() + endif() + diff --git a/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..47a8350d738d4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a0d253d..19518af 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -680,12 +680,7 @@ if(JAS_ENABLE_LIBJPEG) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + jas_get_includes_from_targets(CMAKE_REQUIRED_INCLUDES JPEG::JPEG) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + set(JAS_LIBJPEG_TARGET JPEG::JPEG) From 94a3d2888affe1b976f4dbfab3337e349d5a2c9b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 09:59:25 +0200 Subject: [PATCH 05/21] patch 2.0.33 Signed-off-by: Uilian Ries --- recipes/jasper/all/conandata.yml | 13 +++++----- recipes/jasper/all/conanfile.py | 14 ++--------- .../all/patches/2.0.33-0001-skip-rpath.patch | 24 +++++++++++++++++++ .../patches/2.0.33-0002-find-libjpeg.patch | 18 ++++++++++++++ recipes/jasper/config.yml | 4 ---- 5 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch create mode 100644 recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 997c73aedbdc1..1d02d0ed6a4f2 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -5,12 +5,6 @@ sources: "2.0.33": url: "https://github.com/jasper-software/jasper/archive/refs/tags/version-2.0.33.tar.gz" sha256: "38b8f74565ee9e7fec44657e69adb5c9b2a966ca5947ced5717cde18a7d2eca6" - "2.0.32": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.32.tar.gz" - sha256: "a3583a06698a6d6106f2fc413aa42d65d86bedf9a988d60e5cfa38bf72bc64b9" - "2.0.28": - url: "https://github.com/jasper-software/jasper/archive/version-2.0.28.tar.gz" - sha256: "6b4e5f682be0ab1a5acb0eeb6bf41d6ce17a658bb8e2dbda95de40100939cc88" patches: "3.0.6": - patch_file: "patches/3.0.6-0001-skip-rpath.patch" @@ -19,3 +13,10 @@ patches: - patch_file: "patches/3.0.6-0002-find-libjpeg.patch" patch_description: "check_c_source_compilers does not work with conan gens" patch_type: "conan" + "2.0.33": + - patch_file: "patches/2.0.33-0001-skip-rpath.patch" + patch_description: "Do not enforce rpath configuration" + patch_type: "conan" + - patch_file: "patches/2.0.33-0002-find-libjpeg.patch" + patch_description: "check_c_source_compilers does not work with conan gens" + patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index dd20af87cbb7f..ce6763be9b076 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -12,7 +12,7 @@ class JasperConan(ConanFile): license = "JasPer-2.0" homepage = "https://jasper-software.github.io/jasper" url = "https://github.com/conan-io/conan-center-index" - topics = ("tool-kit", "coding") + topics = ("toolkit", "coding", "jpeg", "images") description = "JasPer Image Processing/Coding Tool Kit" settings = "os", "arch", "compiler", "build_type" options = { @@ -59,21 +59,11 @@ def generate(self): tc.variables["JAS_ENABLE_SHARED"] = self.options.shared tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_OPENGL"] = False + tc.variables["JAS_ENABLE_LIBJPEG"] = True tc.generate() tc = CMakeDeps(self) tc.generate() - def _patch_sources(self): - # INFO: Clean rpath in installed shared lib - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - cmds_to_remove = [ - "set(CMAKE_INSTALL_RPATH \"${CMAKE_INSTALL_PREFIX}/lib\")", - "set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)", - "set(CMAKE_INSTALL_RPATH\n \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")", - ] - for cmd_to_remove in cmds_to_remove: - replace_in_file(self, cmakelists, cmd_to_remove, "") - def build(self): apply_conandata_patches(self) cmake = CMake(self) diff --git a/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch new file mode 100644 index 0000000000000..eb9d47cbbb014 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0001-skip-rpath.patch @@ -0,0 +1,24 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 230d88c..79081c2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -298,19 +298,15 @@ if (JAS_ENABLE_SHARED) + # (but later on when installing) + set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + + # add the automatically determined parts of the RPATH + # which point to directories outside the build tree to the install RPATH +- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # The RPATH to be used when installing, but only if it's not a + # system directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) + if("${isSystemDir}" STREQUAL "-1") +- set(CMAKE_INSTALL_RPATH +- "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + endif("${isSystemDir}" STREQUAL "-1") + + endif() diff --git a/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch new file mode 100644 index 0000000000000..e95e029549359 --- /dev/null +++ b/recipes/jasper/all/patches/2.0.33-0002-find-libjpeg.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 79081c2..38b6238 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,12 +244,7 @@ if (JAS_ENABLE_LIBJPEG AND JPEG_FOUND) + # (e.g., stdio.h and stdint.h). So, we cannot reliably use + # check_include_file here. + set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) +- check_c_source_compiles(" +- #include +- #include +- #include +- int main() {} +- " JAS_HAVE_JPEGLIB_H) ++ set(JAS_HAVE_JPEGLIB_H 1) + if(JAS_HAVE_JPEGLIB_H) + set(JAS_HAVE_LIBJPEG 1) + include_directories(${JPEG_INCLUDE_DIR}) diff --git a/recipes/jasper/config.yml b/recipes/jasper/config.yml index 94f80061ac6c4..8b1f048c0d0c7 100644 --- a/recipes/jasper/config.yml +++ b/recipes/jasper/config.yml @@ -3,7 +3,3 @@ versions: folder: all "2.0.33": folder: all - "2.0.32": - folder: all - "2.0.28": - folder: all From 8b3b9fce3111dbf27325b5d708ed426be3e8422a Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 10:02:09 +0200 Subject: [PATCH 06/21] requires conan 1.52.0 Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index ce6763be9b076..da3bd4bbc69ef 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, replace_in_file, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches import os import textwrap -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.52.0" class JasperConan(ConanFile): From 74b6e83c6c28bdee4495b58934702370e1ea8d89 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 12:15:19 +0200 Subject: [PATCH 07/21] use c99 when cross-building Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index da3bd4bbc69ef..40c99b3823289 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches +from conan.tools.build import cross_building import os import textwrap @@ -60,6 +61,8 @@ def generate(self): tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_OPENGL"] = False tc.variables["JAS_ENABLE_LIBJPEG"] = True + if cross_building(self): + tc.variables["JAS_STDC_VERSION"] = "199901L" tc.generate() tc = CMakeDeps(self) tc.generate() From 26b8a8babf2a399fd9b4f550d64a751b70bd77ae Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 13:22:00 +0200 Subject: [PATCH 08/21] fix cross-building Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 40c99b3823289..f31b4c4d46ddb 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -56,13 +56,15 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["JAS_ENABLE_DOC"] = False + tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False tc.variables["JAS_ENABLE_SHARED"] = self.options.shared tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_OPENGL"] = False tc.variables["JAS_ENABLE_LIBJPEG"] = True if cross_building(self): - tc.variables["JAS_STDC_VERSION"] = "199901L" + tc.cache_variables["JAS_CROSSCOMPILING"] = True + tc.cache_variables["JAS_STDC_VERSION"] = "199901L" tc.generate() tc = CMakeDeps(self) tc.generate() From 4afaa2ec6b0383a91805db1c43529ee4161ca396 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 15:14:56 +0200 Subject: [PATCH 09/21] Add Ninja to avoid sdk Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index f31b4c4d46ddb..2f0de3adacc32 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches from conan.tools.build import cross_building +from conan.tools.env import VirtualBuildEnv import os import textwrap @@ -49,12 +50,16 @@ def requirements(self): elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") + def build_requirements(self): + self.tool_requires("ninja/1.11.0") + def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): - tc = CMakeToolchain(self) + generator = self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str, default="Ninja") + tc = CMakeToolchain(self, generator=generator) tc.variables["JAS_ENABLE_DOC"] = False tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False @@ -68,6 +73,8 @@ def generate(self): tc.generate() tc = CMakeDeps(self) tc.generate() + env = VirtualBuildEnv(self) + env.generate() def build(self): apply_conandata_patches(self) From b4ae258205ce7ad9b1caf927ab9e9441fb20b583 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 4 Oct 2022 16:52:45 +0200 Subject: [PATCH 10/21] Ninja is not mandatory Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 2f0de3adacc32..ca5f765b41603 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -28,6 +28,10 @@ class JasperConan(ConanFile): "with_libjpeg": "libjpeg", } + @property + def _cmake_gen(self): + self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str, default="Ninja") + def export_sources(self): export_conandata_patches(self) From 8020e724e192377bcc28baf03c5091959f86c30e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 6 Oct 2022 10:21:18 +0200 Subject: [PATCH 11/21] Remove duplicated test_package.c Signed-off-by: Uilian Ries --- .../jasper/all/test_v1_package/CMakeLists.txt | 2 +- .../jasper/all/test_v1_package/test_package.c | 43 ------------------- 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 recipes/jasper/all/test_v1_package/test_package.c diff --git a/recipes/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt index 98193eb228a7f..e3483f3ecad56 100644 --- a/recipes/jasper/all/test_v1_package/CMakeLists.txt +++ b/recipes/jasper/all/test_v1_package/CMakeLists.txt @@ -6,5 +6,5 @@ conan_basic_setup(TARGETS) find_package(Jasper REQUIRED CONFIG) -add_executable(${PROJECT_NAME} test_package.c) +add_executable(${PROJECT_NAME} ../test_package/test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_v1_package/test_package.c b/recipes/jasper/all/test_v1_package/test_package.c deleted file mode 100644 index 1391fde1806e7..0000000000000 --- a/recipes/jasper/all/test_v1_package/test_package.c +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#include - -int main(int argc, char **argv) -{ - int i; - jas_tmr_t tmr; - jas_tmr_t dummytmr; - double t; - int numiters; - - numiters = 2; - - jas_tmr_start(&tmr); - for (i = numiters; i > 0; --i) { - jas_tmr_start(&dummytmr); - } - jas_tmr_stop(&tmr); - t = jas_tmr_get(&tmr); - t /= numiters; - printf("jas_tmr_start %.3f us\n", t * 1e6); - - jas_tmr_start(&tmr); - for (i = numiters; i > 0; --i) { - jas_tmr_stop(&dummytmr); - } - jas_tmr_stop(&tmr); - t = jas_tmr_get(&tmr); - t /= numiters; - printf("jas_tmr_stop %.3f us\n", t * 1e6); - - t = 0; - for (i = numiters; i > 0; --i) { - jas_tmr_start(&tmr); - jas_tmr_stop(&tmr); - t += jas_tmr_get(&tmr); - } - t /= numiters; - printf("zero time %.3f us\n", t * 1e6); - - return 0; -} From 918b8f01acadec0c3d0b5b88c22e38cd5f8cdae8 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 6 Oct 2022 13:26:51 +0200 Subject: [PATCH 12/21] Links pthread Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index ca5f765b41603..c95d27346e723 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -134,4 +134,4 @@ def package_info(self): self.cpp_info.libs = ["jasper"] if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.append("m") + self.cpp_info.system_libs.extend(["m", "pthread"]) From e7bb3cfdf2381a35241fe0e5484b788ee529f6e4 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Dec 2022 14:02:07 +0100 Subject: [PATCH 13/21] Use safe deletion Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index c95d27346e723..97e632b0e2cae 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -6,7 +6,7 @@ import os import textwrap -required_conan_version = ">=1.52.0" +required_conan_version = ">=1.53.0" class JasperConan(ConanFile): @@ -40,10 +40,10 @@ def config_options(self): del self.options.fPIC def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if self.options.shared: + self.options.rm_safe("fPIC") def layout(self): cmake_layout(self, src_folder="src") From b2fa33122c217c6ba433f99984913d75ecdf2258 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 4 Nov 2022 15:25:00 +0100 Subject: [PATCH 14/21] Remove Ninja Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 97e632b0e2cae..ce17abed887b0 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -28,10 +28,6 @@ class JasperConan(ConanFile): "with_libjpeg": "libjpeg", } - @property - def _cmake_gen(self): - self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str, default="Ninja") - def export_sources(self): export_conandata_patches(self) @@ -54,16 +50,12 @@ def requirements(self): elif self.options.with_libjpeg == "libjpeg": self.requires("libjpeg/9e") - def build_requirements(self): - self.tool_requires("ninja/1.11.0") - def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): - generator = self.conf.get("tools.cmake.cmaketoolchain:generator", check_type=str, default="Ninja") - tc = CMakeToolchain(self, generator=generator) + tc = CMakeToolchain(self) tc.variables["JAS_ENABLE_DOC"] = False tc.variables["JAS_ENABLE_LATEX"] = False tc.variables["JAS_ENABLE_PROGRAMS"] = False From bbc6726c59466abb5f2f1d345dd6c2e9808fc4e4 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 4 Nov 2022 15:51:10 +0100 Subject: [PATCH 15/21] Validate cmake defs Signed-off-by: Uilian Ries --- recipes/jasper/all/test_package/CMakeLists.txt | 17 +++++++++++++++++ .../jasper/all/test_v1_package/CMakeLists.txt | 6 ++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index c8441e449dd36..69a3592fddd09 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -3,5 +3,22 @@ project(test_package C) find_package(Jasper REQUIRED CONFIG) +set(_custom_vars + Jasper_FOUND + Jasper_INCLUDE_DIRS + Jasper_LIBRARIES + Jasper_VERSION_MAJOR + Jasper_VERSION_MINOR + Jasper_VERSION_PATCH + Jasper_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) +if(DEFINED _custom_var) + message(STATUS "${_custom_var}: ${${_custom_var}}") +else() + message(FATAL_ERROR "${_custom_var} not defined") +endif() +endforeach() + add_executable(${PROJECT_NAME} test_package.c) target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) diff --git a/recipes/jasper/all/test_v1_package/CMakeLists.txt b/recipes/jasper/all/test_v1_package/CMakeLists.txt index e3483f3ecad56..2f6b1a2f7ec79 100644 --- a/recipes/jasper/all/test_v1_package/CMakeLists.txt +++ b/recipes/jasper/all/test_v1_package/CMakeLists.txt @@ -4,7 +4,5 @@ project(test_package C) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(Jasper REQUIRED CONFIG) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE Jasper::Jasper) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) From 6cb06e2061d09532f8bc0d02d750de60bc88d72d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 4 Nov 2022 16:05:27 +0100 Subject: [PATCH 16/21] Validate cmake alias variables Signed-off-by: Uilian Ries --- recipes/jasper/all/conandata.yml | 6 ++++-- recipes/jasper/all/conanfile.py | 1 + recipes/jasper/all/test_package/CMakeLists.txt | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 1d02d0ed6a4f2..2d72f8372b495 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -9,14 +9,16 @@ patches: "3.0.6": - patch_file: "patches/3.0.6-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" patch_type: "conan" - patch_file: "patches/3.0.6-0002-find-libjpeg.patch" - patch_description: "check_c_source_compilers does not work with conan gens" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" patch_type: "conan" "2.0.33": - patch_file: "patches/2.0.33-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" + patch_source: "https://github.com/jasper-software/jasper/pull/347" patch_type: "conan" - patch_file: "patches/2.0.33-0002-find-libjpeg.patch" - patch_description: "check_c_source_compilers does not work with conan gens" + patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" patch_type: "conan" diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index ce17abed887b0..716573b76d903 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -92,6 +92,7 @@ def package(self): os.path.join(self.package_folder, self._module_file_rel_path) ) + # FIXME: Missing CMake alias variables. See https://github.com/conan-io/conan/issues/7691 @staticmethod def _create_cmake_module_variables(conanfile, module_file): content = textwrap.dedent("""\ diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index 69a3592fddd09..e4ed46f287fc8 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -11,6 +11,10 @@ set(_custom_vars Jasper_VERSION_MINOR Jasper_VERSION_PATCH Jasper_VERSION_STRING + JASPER_FOUND + JASPER_INCLUDE_DIR + JASPER_LIBRARIES + JASPER_VERSION_STRING ) foreach(_custom_var ${_custom_vars}) if(DEFINED _custom_var) From 116da3ef803e1dd594fbc747ceea1a54fb9fb303 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 4 Nov 2022 18:13:34 +0100 Subject: [PATCH 17/21] Update recipes/jasper/all/test_package/CMakeLists.txt Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/jasper/all/test_package/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index e4ed46f287fc8..393fc418f201f 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -4,13 +4,6 @@ project(test_package C) find_package(Jasper REQUIRED CONFIG) set(_custom_vars - Jasper_FOUND - Jasper_INCLUDE_DIRS - Jasper_LIBRARIES - Jasper_VERSION_MAJOR - Jasper_VERSION_MINOR - Jasper_VERSION_PATCH - Jasper_VERSION_STRING JASPER_FOUND JASPER_INCLUDE_DIR JASPER_LIBRARIES From 3e2c3463c0109cf58ad97bbf6314693eb658b26c Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:51:09 +0100 Subject: [PATCH 18/21] cleanup & small improvements --- recipes/jasper/all/conanfile.py | 35 ++++++++----------- .../jasper/all/test_package/CMakeLists.txt | 4 +-- recipes/jasper/all/test_package/conanfile.py | 6 ++-- .../jasper/all/test_v1_package/conanfile.py | 4 +-- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 716573b76d903..56fa455cf3d09 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -1,8 +1,7 @@ from conan import ConanFile -from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, rm, save, export_conandata_patches, apply_conandata_patches from conan.tools.build import cross_building -from conan.tools.env import VirtualBuildEnv +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save import os import textwrap @@ -52,7 +51,7 @@ def requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + destination=self.source_folder, strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -69,8 +68,6 @@ def generate(self): tc.generate() tc = CMakeDeps(self) tc.generate() - env = VirtualBuildEnv(self) - env.generate() def build(self): apply_conandata_patches(self) @@ -87,18 +84,13 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) if self.settings.os == "Windows": for dll_prefix in ["concrt", "msvcp", "vcruntime"]: - rm(self, "{}*.dll".format(dll_prefix), os.path.join(self.package_folder, "bin")) - self._create_cmake_module_variables(self, - os.path.join(self.package_folder, self._module_file_rel_path) - ) + rm(self, f"{dll_prefix}*.dll", os.path.join(self.package_folder, "bin")) + self._create_cmake_module_variables(os.path.join(self.package_folder, self._module_file_rel_path)) # FIXME: Missing CMake alias variables. See https://github.com/conan-io/conan/issues/7691 - @staticmethod - def _create_cmake_module_variables(conanfile, module_file): + def _create_cmake_module_variables(self, module_file): content = textwrap.dedent("""\ - if(DEFINED Jasper_FOUND) - set(JASPER_FOUND ${Jasper_FOUND}) - endif() + set(JASPER_FOUND TRUE) if(DEFINED Jasper_INCLUDE_DIR) set(JASPER_INCLUDE_DIR ${Jasper_INCLUDE_DIR}) endif() @@ -109,22 +101,23 @@ def _create_cmake_module_variables(conanfile, module_file): set(JASPER_VERSION_STRING ${Jasper_VERSION}) endif() """) - save(conanfile, module_file, content) + save(self, module_file, content) @property def _module_file_rel_path(self): - return os.path.join("lib", "cmake", "conan-official-{}-variables.cmake".format(self.name)) + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") self.cpp_info.set_property("cmake_file_name", "Jasper") self.cpp_info.set_property("cmake_target_name", "Jasper::Jasper") self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) self.cpp_info.set_property("pkg_config_name", "jasper") + self.cpp_info.libs = ["jasper"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "pthread"]) + # TODO: to remove in conan v2 self.cpp_info.names["cmake_find_package"] = "Jasper" self.cpp_info.names["cmake_find_package_multi"] = "Jasper" self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] - - self.cpp_info.libs = ["jasper"] - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.system_libs.extend(["m", "pthread"]) diff --git a/recipes/jasper/all/test_package/CMakeLists.txt b/recipes/jasper/all/test_package/CMakeLists.txt index 393fc418f201f..54cd6e29fc23c 100644 --- a/recipes/jasper/all/test_package/CMakeLists.txt +++ b/recipes/jasper/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1) -project(test_package C) +project(test_package LANGUAGES C) -find_package(Jasper REQUIRED CONFIG) +find_package(Jasper REQUIRED) set(_custom_vars JASPER_FOUND diff --git a/recipes/jasper/all/test_package/conanfile.py b/recipes/jasper/all/test_package/conanfile.py index a9fb96656f203..e845ae751a301 100644 --- a/recipes/jasper/all/test_package/conanfile.py +++ b/recipes/jasper/all/test_package/conanfile.py @@ -9,12 +9,12 @@ class TestPackageConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" - def requirements(self): - self.requires(self.tested_reference_str) - def layout(self): cmake_layout(self) + def requirements(self): + self.requires(self.tested_reference_str) + def build(self): cmake = CMake(self) cmake.configure() diff --git a/recipes/jasper/all/test_v1_package/conanfile.py b/recipes/jasper/all/test_v1_package/conanfile.py index 49a3a66ea5bad..19e6a0c06e3d8 100644 --- a/recipes/jasper/all/test_v1_package/conanfile.py +++ b/recipes/jasper/all/test_v1_package/conanfile.py @@ -3,8 +3,8 @@ class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" def build(self): cmake = CMake(self) From 69e29abb6fedac291e673771acf1356cea1b1ae1 Mon Sep 17 00:00:00 2001 From: SpaceIm <30052553+SpaceIm@users.noreply.github.com> Date: Mon, 14 Nov 2022 21:59:48 +0100 Subject: [PATCH 19/21] deterministic libname --- recipes/jasper/all/conandata.yml | 3 +++ .../patches/3.0.6-0003-deterministic-libname.patch | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch diff --git a/recipes/jasper/all/conandata.yml b/recipes/jasper/all/conandata.yml index 2d72f8372b495..e929114808462 100644 --- a/recipes/jasper/all/conandata.yml +++ b/recipes/jasper/all/conandata.yml @@ -14,6 +14,9 @@ patches: - patch_file: "patches/3.0.6-0002-find-libjpeg.patch" patch_description: "check_c_source_compilers does not work with conan gens. See https://github.com/conan-io/conan/issues/12180" patch_type: "conan" + - patch_file: "patches/3.0.6-0003-deterministic-libname.patch" + patch_description: "No generator dependent libname" + patch_type: "conan" "2.0.33": - patch_file: "patches/2.0.33-0001-skip-rpath.patch" patch_description: "Do not enforce rpath configuration" diff --git a/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch new file mode 100644 index 0000000000000..567ff16e021a4 --- /dev/null +++ b/recipes/jasper/all/patches/3.0.6-0003-deterministic-libname.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -254,7 +254,7 @@ endif() + # If a multiconfiguration generator is used, ensure that various output + # files are not placed in subdirectories (such as Debug and Release) + # as this will cause the CTest test suite to fail. +-if(JAS_MULTICONFIGURATION_GENERATOR) ++if(0) + if(CMAKE_CONFIGURATION_TYPES) + set(CMAKE_DEBUG_POSTFIX d) + endif() From bb7f014765c7fc9a8a8da6c097ee6642a5a8fdc5 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Dec 2022 11:21:37 +0100 Subject: [PATCH 20/21] Use latest Windows SDK available Adopt a workaround provided by @jcar87, which is a temporary hotfix until having https://github.com/conan-io/conan-center-index/issues/13159 fixed. Signed-off-by: Uilian Ries --- recipes/jasper/all/conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index 56fa455cf3d09..b15c3ca21b88c 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -2,6 +2,7 @@ from conan.tools.build import cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, save +from conan.tools.microsoft import is_msvc import os import textwrap @@ -69,6 +70,12 @@ def generate(self): tc = CMakeDeps(self) tc.generate() + # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 + # C3I workaround to force CMake to choose the highest version of + # the windows SDK available in the system + if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): + tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + def build(self): apply_conandata_patches(self) cmake = CMake(self) From 00308371fcc4cacbb140d0aaebc4627a37011d4b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Dec 2022 11:36:18 +0100 Subject: [PATCH 21/21] Fix toolchain position variables --- recipes/jasper/all/conanfile.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/recipes/jasper/all/conanfile.py b/recipes/jasper/all/conanfile.py index b15c3ca21b88c..d677d22f394d5 100644 --- a/recipes/jasper/all/conanfile.py +++ b/recipes/jasper/all/conanfile.py @@ -63,12 +63,10 @@ def generate(self): tc.variables["JAS_LIBJPEG_REQUIRED"] = "REQUIRED" tc.variables["JAS_ENABLE_OPENGL"] = False tc.variables["JAS_ENABLE_LIBJPEG"] = True + if cross_building(self): tc.cache_variables["JAS_CROSSCOMPILING"] = True tc.cache_variables["JAS_STDC_VERSION"] = "199901L" - tc.generate() - tc = CMakeDeps(self) - tc.generate() # TODO: Remove after fixing https://github.com/conan-io/conan-center-index/issues/13159 # C3I workaround to force CMake to choose the highest version of @@ -76,6 +74,11 @@ def generate(self): if is_msvc(self) and not self.conf.get("tools.cmake.cmaketoolchain:system_version"): tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0" + tc.generate() + + cmakedeps = CMakeDeps(self) + cmakedeps.generate() + def build(self): apply_conandata_patches(self) cmake = CMake(self)