From 6d72dd61eb598fb1f903066286a7805464874662 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 31 Jul 2023 15:10:11 +0300 Subject: [PATCH 01/45] openscenegraph: migrate to Conan v2 --- recipes/openscenegraph/all/CMakeLists.txt | 23 -- recipes/openscenegraph/all/conandata.yml | 6 - recipes/openscenegraph/all/conanfile.py | 241 ++++++++++-------- .../all/test_package/CMakeLists.txt | 13 +- .../all/test_package/conanfile.py | 41 ++- .../all/test_v1_package/CMakeLists.txt | 8 + .../all/test_v1_package/conanfile.py | 26 ++ 7 files changed, 196 insertions(+), 162 deletions(-) delete mode 100644 recipes/openscenegraph/all/CMakeLists.txt create mode 100644 recipes/openscenegraph/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/openscenegraph/all/test_v1_package/conanfile.py diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt deleted file mode 100644 index a0749127966c0..0000000000000 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 3.1.2) -project(cmake_wrapper) - -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(NO_OUTPUT_DIRS) - -# Hack to insure that conan's copy of these are used, rather than CMake's -# If this isn't here, find_package(X11) will pull in CMake's copy -find_package(Freetype QUIET) -find_package(Fontconfig QUIET) - -# Workaround limitations of the cmake_find_package generator -set(FREETYPE_FOUND ${Freetype_FOUND}) -if(FREETYPE_FOUND) - set(FREETYPE_LIBRARIES ${Freetype_LIBRARIES}) - set(FREETYPE_INCLUDE_DIRS ${Freetype_INCLUDE_DIRS}) -endif() - -if(APPLE) - add_compile_definitions("GL_SILENCE_DEPRECATION") -endif() - -add_subdirectory("source_subfolder") diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 0f1b6a2cc4790..16fc20e788266 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -5,14 +5,8 @@ sources: patches: 3.6.5: - patch_file: patches/0001-fix-to_cmake_path-usage.patch - base_path: source_subfolder - patch_file: patches/0002-Use-standard-CMake-name-for-gif.patch - base_path: source_subfolder - patch_file: patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch - base_path: source_subfolder - patch_file: patches/0004-Allow-explicit-control-of-plugins.patch - base_path: source_subfolder - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - base_path: source_subfolder - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch - base_path: source_subfolder diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 5d6b6d3a14882..a73cbeb9e7b84 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -1,25 +1,25 @@ +import os + from conan import ConanFile -from conan.tools.files import get, rmdir, rm, apply_conandata_patches +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os 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 from conan.tools.scm import Version -from conan.tools.apple import is_apple_os -from conan.errors import ConanInvalidConfiguration -from conans import CMake -import os -import functools - -required_conan_version = ">=1.50.0" +required_conan_version = ">=1.53.0" class OpenSceneGraphConanFile(ConanFile): name = "openscenegraph" description = "OpenSceneGraph is an open source high performance 3D graphics toolkit" - topics = ("openscenegraph", "graphics") + license = ("LGPL-2.1-only", "WxWindows-exception-3.1") url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.openscenegraph.org" - license = "LGPL-2.1-only", "WxWindows-exception-3.1" + topics = ("graphics",) + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -78,13 +78,9 @@ class OpenSceneGraphConanFile(ConanFile): "opengl_profile": "gl2", } - short_paths = True - exports_sources = "CMakeLists.txt", "patches/*.patch" - generators = "cmake", "cmake_find_package" - - @property - def _source_subfolder(self): - return "source_subfolder" + def export_sources(self): + copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -105,22 +101,19 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") if not self.options.with_zlib: # These require zlib support - del self.options.with_openexr - del self.options.with_png - del self.options.with_dcmtk + self.options.rm_safe("with_openexr") + self.options.rm_safe("with_png") + self.options.rm_safe("with_dcmtk") - def validate(self): - if self.options.get_safe("with_asio", False): - raise ConanInvalidConfiguration("ASIO support in OSG is broken, see https://github.com/openscenegraph/OpenSceneGraph/issues/921") - if hasattr(self, "settings_build") and cross_building(self): - raise ConanInvalidConfiguration("openscenegraph recipe cannot be cross-built yet. Contributions are welcome.") + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): - if self.options.enable_windowing_system and self.settings.os == "Linux": + if self.options.enable_windowing_system and self.settings.os in ["Linux", "FreeBSD"]: self.requires("xorg/system") self.requires("opengl/system") @@ -129,26 +122,26 @@ def requirements(self): if self.options.get_safe("with_asio", False): # Should these be private requires? - self.requires("asio/1.22.1") - self.requires("boost/1.81.0") + self.requires("asio/1.28.0") + self.requires("boost/1.82.0") if self.options.with_curl: - self.requires("libcurl/8.0.1") + self.requires("libcurl/8.2.0") if self.options.get_safe("with_dcmtk"): - self.requires("dcmtk/3.6.6") + self.requires("dcmtk/3.6.7") if self.options.with_freetype: self.requires("freetype/2.13.0") if self.options.with_gdal: - self.requires("gdal/3.4.3") + self.requires("gdal/3.5.2") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_jasper: - self.requires("jasper/2.0.33") + self.requires("jasper/4.0.0") if self.options.get_safe("with_jpeg"): self.requires("libjpeg/9e") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.7") + self.requires("openexr/3.1.9") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.with_tiff: @@ -156,90 +149,107 @@ def requirements(self): if self.options.with_zlib: self.requires("zlib/1.2.13") - def source(self): - get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def _patch_sources(self): - apply_conandata_patches(self) - - for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): - # Prefer conan's find package scripts over osg's - os.unlink(os.path.join(self._source_subfolder, "CMakeModules", "Find{}.cmake".format(package))) + def validate(self): + if self.options.get_safe("with_asio", False): + raise ConanInvalidConfiguration( + "ASIO support in OSG is broken, " + "see https://github.com/openscenegraph/OpenSceneGraph/issues/921" + ) + if hasattr(self, "settings_build") and cross_building(self): + raise ConanInvalidConfiguration( + "openscenegraph recipe cannot be cross-built yet. " + "Contributions are welcome." + ) - @functools.lru_cache(1) - def _configured_cmake(self): - cmake = CMake(self) + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) - cmake.definitions["USE_3RDPARTY_BIN"] = False + def generate(self): + tc = CMakeToolchain(self) + tc.variables["USE_3RDPARTY_BIN"] = False - cmake.definitions["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared - cmake.definitions["DYNAMIC_OPENTHREADS"] = self.options.shared + tc.variables["DYNAMIC_OPENSCENEGRAPH"] = self.options.shared + tc.variables["DYNAMIC_OPENTHREADS"] = self.options.shared - cmake.definitions["BUILD_OSG_APPLICATIONS"] = self.options.build_applications - cmake.definitions["BUILD_OSG_EXAMPLES"] = False + tc.variables["BUILD_OSG_APPLICATIONS"] = self.options.build_applications + tc.variables["BUILD_OSG_EXAMPLES"] = False - cmake.definitions["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify - cmake.definitions["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api - cmake.definitions["OSG_PROVIDE_READFILE"] = self.options.enable_readfile - cmake.definitions["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion - cmake.definitions["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference - cmake.definitions["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support + tc.variables["OSG_NOTIFY_DISABLED"] = not self.options.enable_notify + tc.variables["OSG_USE_DEPRECATED_API"] = self.options.enable_deprecated_api + tc.variables["OSG_PROVIDE_READFILE"] = self.options.enable_readfile + tc.variables["OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION"] = self.options.enable_ref_ptr_implicit_output_conversion + tc.variables["OSG_USE_REF_PTR_SAFE_DEREFERENCE"] = self.options.enable_ref_ptr_safe_dereference + tc.variables["OSG_ENVVAR_SUPPORTED"] = self.options.enable_envvar_support if not self.options.enable_windowing_system: - cmake.definitions["OSG_WINDOWING_SYSTEM"] = None + tc.variables["OSG_WINDOWING_SYSTEM"] = None - cmake.definitions["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers + tc.variables["BUILD_OSG_DEPRECATED_SERIALIZERS"] = self.options.enable_deprecated_serializers - cmake.definitions["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig + tc.variables["OSG_TEXT_USE_FONTCONFIG"] = self.options.use_fontconfig - cmake.definitions["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() + tc.variables["OPENGL_PROFILE"] = str(self.options.opengl_profile).upper() # Disable option dependencies unless we have a package for them - cmake.definitions["OSG_WITH_FREETYPE"] = self.options.with_freetype - cmake.definitions["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) - cmake.definitions["OSG_WITH_INVENTOR"] = False - cmake.definitions["OSG_WITH_JASPER"] = self.options.with_jasper - cmake.definitions["OSG_WITH_OPENCASCADE"] = False - cmake.definitions["OSG_WITH_FBX"] = False - cmake.definitions["OSG_WITH_ZLIB"] = self.options.with_zlib - cmake.definitions["OSG_WITH_GDAL"] = self.options.with_gdal - cmake.definitions["OSG_WITH_GTA"] = self.options.with_gta - cmake.definitions["OSG_WITH_CURL"] = self.options.with_curl - cmake.definitions["OSG_WITH_LIBVNCSERVER"] = False - cmake.definitions["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) - cmake.definitions["OSG_WITH_FFMPEG"] = False - cmake.definitions["OSG_WITH_DIRECTSHOW"] = False - cmake.definitions["OSG_WITH_SDL"] = False - cmake.definitions["OSG_WITH_POPPLER"] = False - cmake.definitions["OSG_WITH_RSVG"] = False - cmake.definitions["OSG_WITH_NVTT"] = False - cmake.definitions["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) - cmake.definitions["OSG_WITH_ZEROCONF"] = False - cmake.definitions["OSG_WITH_LIBLAS"] = False - cmake.definitions["OSG_WITH_GIF"] = self.options.get_safe("with_gif", False) - cmake.definitions["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) - cmake.definitions["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) - cmake.definitions["OSG_WITH_TIFF"] = self.options.with_tiff + tc.variables["OSG_WITH_FREETYPE"] = self.options.with_freetype + tc.variables["OSG_WITH_OPENEXR"] = self.options.get_safe("with_openexr", False) + tc.variables["OSG_WITH_INVENTOR"] = False + tc.variables["OSG_WITH_JASPER"] = self.options.with_jasper + tc.variables["OSG_WITH_OPENCASCADE"] = False + tc.variables["OSG_WITH_FBX"] = False + tc.variables["OSG_WITH_ZLIB"] = self.options.with_zlib + tc.variables["OSG_WITH_GDAL"] = self.options.with_gdal + tc.variables["OSG_WITH_GTA"] = self.options.with_gta + tc.variables["OSG_WITH_CURL"] = self.options.with_curl + tc.variables["OSG_WITH_LIBVNCSERVER"] = False + tc.variables["OSG_WITH_DCMTK"] = self.options.get_safe("with_dcmtk", False) + tc.variables["OSG_WITH_FFMPEG"] = False + tc.variables["OSG_WITH_DIRECTSHOW"] = False + tc.variables["OSG_WITH_SDL"] = False + tc.variables["OSG_WITH_POPPLER"] = False + tc.variables["OSG_WITH_RSVG"] = False + tc.variables["OSG_WITH_NVTT"] = False + tc.variables["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) + tc.variables["OSG_WITH_ZEROCONF"] = False + tc.variables["OSG_WITH_LIBLAS"] = False + tc.variables["OSG_WITH_GIF"] = self.options.get_safe("with_gif", False) + tc.variables["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) + tc.variables["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) + tc.variables["OSG_WITH_TIFF"] = self.options.with_tiff if self.settings.os == "Windows": # osg has optional quicktime support on Windows - cmake.definitions["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True - cmake.definitions["OSG_MSVC_VERSIONED_DLL"] = False + tc.variables["OSG_MSVC_VERSIONED_DLL"] = False - cmake.configure() + if is_apple_os(self): + tc.preprocessor_definitions["GL_SILENCE_DEPRECATION"] = "1" + + tc.generate() + + deps = CMakeDeps(self) + deps.set_property("freetype", "cmake_module_file_name", "FREETYPE") + deps.generate() - return cmake + def _patch_sources(self): + apply_conandata_patches(self) + + for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): + # Prefer conan's find package scripts over osg's + os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) def build(self): self._patch_sources() - - self._configured_cmake().build() + cmake = CMake(self) + cmake.configure() + cmake.build() def package(self): - self._configured_cmake().install() + cmake = CMake(self) + cmake.install() - self.copy(pattern="LICENSE.txt", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, True) @@ -255,6 +265,10 @@ def package_info(self): # but it will set the last three of these if the name of the package is OPENSCENEGRAPH (it uses # the filename for the first, so OpenSceneGraph_FOUND gets set, not OPENSCENEGRAPH_FOUND) # TODO: set OPENSCENEGRAPH_FOUND in cmake_find_package and cmake_find_package_multi + self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") + self.cpp_info.set_property("cmake_target_name", "OPENSCENEGRAPH::OPENSCENEGRAPH") + + # TODO: to remove in conan v2 once cmake_find_package_* generators removed self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" self.cpp_info.names["cmake_find_package"] = "OPENSCENEGRAPH" @@ -275,23 +289,23 @@ def setup_plugin(plugin): plugin_library.libs = [] if self.options.shared else [lib + postfix] plugin_library.requires = ["OpenThreads", "osg", "osgDB", "osgUtil"] if not self.options.shared: - plugin_library.libdirs = [os.path.join("lib", "osgPlugins-{}".format(self.version))] + plugin_library.libdirs = [os.path.join("lib", f"osgPlugins-{self.version}")] return plugin_library def setup_serializers(lib): plugins = [] if lib not in ("osgDB", "osgWidget", "osgPresentation"): - plugins.append("serializers_{}".format(lib.lower())) + plugins.append(f"serializers_{lib.lower()}") if self.options.enable_deprecated_serializers: if lib not in ("osgUtil", "osgDB", "osgGA", "osgManipulator", "osgUI", "osgPresentation"): - plugins.append("deprecated_{}".format(lib.lower())) + plugins.append(f"deprecated_{lib.lower()}") for plugin in plugins: setup_plugin(plugin).requires.append(lib) def setup_library(lib): library = self.cpp_info.components[lib] library.libs = [lib + postfix] - library.names["pkg_config"] = "openscenegraph-{}".format(lib) + library.set_property("pkg_config_name", f"openscenegraph-{lib}") setup_serializers(lib) return library @@ -302,22 +316,22 @@ def setup_library(lib): # files for it with cmake_find_package and cmake_find_package_multi library = self.cpp_info.components["OpenThreads"] library.libs = ["OpenThreads" + postfix] - library.names["pkg_config"] = "openthreads" - if self.settings.os == "Linux": + library.set_property("pkg_config_name", "openthreads") + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["pthread"] library = setup_library("osg") library.requires = ["OpenThreads", "opengl::opengl"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["m", "rt", "dl"] if not self.options.shared: library.defines.append("OSG_LIBRARY_STATIC") library = setup_library("osgDB") library.requires = ["osg", "osgUtil", "OpenThreads"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["dl"] - elif self.settings.os == "Macos": + elif is_apple_os(self): library.frameworks = ["Carbon", "Cocoa"] if self.options.with_zlib: library.requires.append("zlib::zlib") @@ -333,7 +347,7 @@ def setup_library(lib): library = setup_library("osgViewer") library.requires = ["osgGA", "osgText", "osgDB", "osgUtil", "osg"] if self.options.enable_windowing_system: - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: library.requires.append("xorg::xorg") elif is_apple_os(self): library.frameworks = ["Cocoa"] @@ -350,7 +364,8 @@ def setup_library(lib): setup_library("osgSim").requires = ["osgText", "osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgTerrain").requires = ["osgUtil", "osgDB", "osg", "OpenThreads"] setup_library("osgWidget").requires = ["osgText", "osgViewer", "osgDB", "osg", "OpenThreads"] - setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] + setup_library("osgPresentation").requires = ["osgViewer", "osgUI", "osgWidget", "osgManipulator", "osgVolume", + "osgFX", "osgText", "osgGA", "osgUtil", "osgDB", "osg", "OpenThreads"] # Start of plugins @@ -484,16 +499,24 @@ def setup_library(lib): if is_apple_os(self): setup_plugin("imageio").frameworks = ["Accelerate"] - if ((self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") - or (self.settings.os == "iOS" and Version(self.settings.os.version) >= "6.0")): + if ( + is_apple_os(self) + and self.settings.os.version + and Version(self.settings.os.version) >= "10.8" + ) or (self.settings.os == "iOS" and Version(self.settings.os.version) >= "6.0"): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] - if self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) <= "10.6" and self.settings.arch == "x86": + if ( + is_apple_os(self) + and self.settings.os.version + and Version(self.settings.os.version) <= "10.6" + and self.settings.arch == "x86" + ): setup_plugin("qt").frameworks = ["QuickTime"] - if self.settings.os == "Macos" and self.settings.arch == "x86": + if is_apple_os(self) and self.settings.arch == "x86": plugin = setup_plugin("QTKit") plugin.requires.append("osgViewer") plugin.frameworks = ["QTKit", "Cocoa", "QuickTime", "CoreVideo"] diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index c2aca0be1b70a..7512bd4b87abc 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -1,16 +1,8 @@ -cmake_minimum_required(VERSION 3.1.2) -project(test_package) - -include(${PROJECT_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES CXX) find_package(OpenSceneGraph REQUIRED) -include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) -link_libraries(${OPENSCENEGRAPH_LIBRARIES}) -add_compile_definitions(${OPENSCENEGRAPH_COMPILE_DEFINITIONS}) - - get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) foreach(cache_variable ${cache_variables}) if("${cache_variable}" MATCHES "^OSG_HAS_(WITH_.+)$") @@ -19,3 +11,4 @@ foreach(cache_variable ${cache_variables}) endforeach() add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} OPENSCENEGRAPH::OPENSCENEGRAPH) diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index 0e02c2d008408..e8d87cadb7e1e 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -1,25 +1,38 @@ -from conans import CMake, ConanFile, tools +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain import os class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package" + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" - def build(self): - cmake = CMake(self) - for key, value in self.options["openscenegraph"].items(): + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def generate(self): + tc = CMakeToolchain(self) + for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): - cmake.definitions["OSG_HAS_" + key.upper()] = 1 if value else 0 - if self.settings.os == "Macos": - cmake.definitions["OSG_HAS_WITH_GIF"] = 0 - cmake.definitions["OSG_HAS_WITH_JPEG"] = 0 - cmake.definitions["OSG_HAS_WITH_PNG"] = 0 + tc.variables["OSG_HAS_" + key.upper()] = 1 if value else 0 + if is_apple_os(self): + tc.variables["OSG_HAS_WITH_GIF"] = 0 + tc.variables["OSG_HAS_WITH_JPEG"] = 0 + tc.variables["OSG_HAS_WITH_PNG"] = 0 + tc.generate() + 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) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt b/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000000000..91630d79f4abb --- /dev/null +++ b/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/openscenegraph/all/test_v1_package/conanfile.py b/recipes/openscenegraph/all/test_v1_package/conanfile.py new file mode 100644 index 0000000000000..0297948c57332 --- /dev/null +++ b/recipes/openscenegraph/all/test_v1_package/conanfile.py @@ -0,0 +1,26 @@ +from conan.tools.apple import is_apple_os +from conans import CMake, ConanFile, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + for key, value in self.options["openscenegraph"].items(): + if key.startswith("with_"): + cmake.definitions["OSG_HAS_" + key.upper()] = 1 if value else 0 + if is_apple_os(self): + cmake.definitions["OSG_HAS_WITH_GIF"] = 0 + cmake.definitions["OSG_HAS_WITH_JPEG"] = 0 + cmake.definitions["OSG_HAS_WITH_PNG"] = 0 + + 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) From b5d14fb189c0e16ba923613a207e2ce54b9eabc6 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 3 Aug 2023 13:19:00 +0300 Subject: [PATCH 02/45] openscenegraph: improve patching --- recipes/openscenegraph/all/conandata.yml | 4 - recipes/openscenegraph/all/conanfile.py | 27 +- .../0001-fix-to_cmake_path-usage.patch | 31 --- ...0002-Use-standard-CMake-name-for-gif.patch | 54 ---- ...rect-usage-of-_LIBRARY-to-_LIBRARIES.patch | 155 ----------- ...04-Allow-explicit-control-of-plugins.patch | 259 ------------------ 6 files changed, 21 insertions(+), 509 deletions(-) delete mode 100644 recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch delete mode 100644 recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch delete mode 100644 recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch delete mode 100644 recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 16fc20e788266..b834a7df8daac 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -4,9 +4,5 @@ sources: url: https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz patches: 3.6.5: - - patch_file: patches/0001-fix-to_cmake_path-usage.patch - - patch_file: patches/0002-Use-standard-CMake-name-for-gif.patch - - patch_file: patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch - - patch_file: patches/0004-Allow-explicit-control-of-plugins.patch - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index a73cbeb9e7b84..90f1283ae7383 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -1,11 +1,12 @@ import os +import re from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os 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 +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir, replace_in_file from conan.tools.scm import Version required_conan_version = ">=1.53.0" @@ -212,7 +213,7 @@ def generate(self): tc.variables["OSG_WITH_ASIO"] = self.options.get_safe("with_asio", False) tc.variables["OSG_WITH_ZEROCONF"] = False tc.variables["OSG_WITH_LIBLAS"] = False - tc.variables["OSG_WITH_GIF"] = self.options.get_safe("with_gif", False) + tc.variables["OSG_WITH_GIFLIB"] = self.options.get_safe("with_gif", False) tc.variables["OSG_WITH_JPEG"] = self.options.get_safe("with_jpeg", False) tc.variables["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) tc.variables["OSG_WITH_TIFF"] = self.options.with_tiff @@ -230,14 +231,29 @@ def generate(self): deps = CMakeDeps(self) deps.set_property("freetype", "cmake_module_file_name", "FREETYPE") + deps.set_property("giflib", "cmake_file_name", "GIFLIB") deps.generate() def _patch_sources(self): - apply_conandata_patches(self) - for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): # Prefer conan's find package scripts over osg's os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) + for path in (self.source_path / "src" / "osgPlugins").rglob("CMakeLists.txt"): + content = path.read_text() + # Correct usage of *_LIBRARY variables to *_LIBRARIES + content = content.replace("_LIBRARY", "_LIBRARIES") + # Allow explicit control of plugins via OSG_WITH_* variables + # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) + content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) + path.write_text(content) + # Fix file(to_cmake_path ...) usage + path = self.source_path / "CMakeModules" / "OsgMacroUtils.cmake" + content = path.read_text() + content = re.sub(r'FILE\(TO_CMAKE_PATH TMPVAR "CMAKE_(\w+)_OUTPUT_DIRECTORY/\$\{RELATIVE_OUTDIR}"\)', + r'FILE(TO_CMAKE_PATH "\${CMAKE_\1_OUTPUT_DIRECTORY}/\${RELATIVE_OUTDIR}" TMPVAR)', + content) + path.write_text(content) + apply_conandata_patches(self) def build(self): self._patch_sources() @@ -249,7 +265,7 @@ def package(self): cmake = CMake(self) cmake.install() - copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, True) @@ -264,7 +280,6 @@ def package_info(self): # Unfortunately, the cmake_find_package generators don't currently allow directly setting variables, # but it will set the last three of these if the name of the package is OPENSCENEGRAPH (it uses # the filename for the first, so OpenSceneGraph_FOUND gets set, not OPENSCENEGRAPH_FOUND) - # TODO: set OPENSCENEGRAPH_FOUND in cmake_find_package and cmake_find_package_multi self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") self.cpp_info.set_property("cmake_target_name", "OPENSCENEGRAPH::OPENSCENEGRAPH") diff --git a/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch b/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch deleted file mode 100644 index a9cda7609830e..0000000000000 --- a/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch +++ /dev/null @@ -1,31 +0,0 @@ -From bfdb151022c98b065a839a4fbf2995ef9340f6ae Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Mon, 21 Sep 2020 10:37:10 -0700 -Subject: [PATCH 1/5] fix to_cmake_path usage - ---- - CMakeModules/OsgMacroUtils.cmake | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake -index dcc1fe37d..c0c2da4e1 100644 ---- a/CMakeModules/OsgMacroUtils.cmake -+++ b/CMakeModules/OsgMacroUtils.cmake -@@ -174,11 +174,11 @@ MACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR) - # Using the output directory properties - - # Global properties (All generators but VS & Xcode) -- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_ARCHIVE_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") -+ FILE(TO_CMAKE_PATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) - SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${TMPVAR}") -- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_RUNTIME_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") -+ FILE(TO_CMAKE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) - SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TMPVAR}") -- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_LIBRARY_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") -+ FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) - SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TMPVAR}") - - # Per-configuration property (VS, Xcode) --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch b/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch deleted file mode 100644 index 7a75a5c326228..0000000000000 --- a/recipes/openscenegraph/all/patches/0002-Use-standard-CMake-name-for-gif.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 17ad9caac56282e89d0e6a62c9564b99e2736225 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 16:51:45 -0700 -Subject: [PATCH 2/5] Use standard CMake name for gif - ---- - CMakeLists.txt | 2 +- - src/osgPlugins/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0ef2edd33..5e0c8f349 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -813,7 +813,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) - # can use Quicktime. - IF(NOT ANDROID) - IF(NOT APPLE) -- FIND_PACKAGE(GIFLIB) -+ FIND_PACKAGE(GIF) - FIND_PACKAGE(JPEG) - FIND_PACKAGE(PNG) - FIND_PACKAGE(TIFF) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 812550412..2a88684b5 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -108,7 +108,7 @@ ENDIF() - IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIFLIB_FOUND) -+IF(GIF_FOUND) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() - IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 642339af1..0db0296cc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ --INCLUDE_DIRECTORIES( ${GIFLIB_INCLUDE_DIR} ) -+INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIFLIB_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) - #### end var setup ### - SETUP_PLUGIN(gif) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch b/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch deleted file mode 100644 index b3965bd4897eb..0000000000000 --- a/recipes/openscenegraph/all/patches/0003-Correct-usage-of-_LIBRARY-to-_LIBRARIES.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 4925ff028681f79b8c0cb1d8e0772ca026c6e63e Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:06:49 -0700 -Subject: [PATCH 3/5] Correct usage of *_LIBRARY to *_LIBRARIES - ---- - src/osgPlugins/curl/CMakeLists.txt | 4 ++-- - src/osgPlugins/gdal/CMakeLists.txt | 2 +- - src/osgPlugins/gif/CMakeLists.txt | 2 +- - src/osgPlugins/gta/CMakeLists.txt | 2 +- - src/osgPlugins/jp2/CMakeLists.txt | 2 +- - src/osgPlugins/jpeg/CMakeLists.txt | 2 +- - src/osgPlugins/ogr/CMakeLists.txt | 2 +- - src/osgPlugins/png/CMakeLists.txt | 2 +- - src/osgPlugins/tiff/CMakeLists.txt | 2 +- - src/osgPlugins/vnc/CMakeLists.txt | 2 +- - 10 files changed, 11 insertions(+), 11 deletions(-) - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 667631f07..4afb738c7 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -23,11 +23,11 @@ SET(TARGET_H - - IF(ZLIB_FOUND) - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY -+ CURL_LIBRARIES - ZLIB_LIBRARIES) - ELSE() - SET(TARGET_LIBRARIES_VARS -- CURL_LIBRARY) -+ CURL_LIBRARIES) - ENDIF() - - IF(WIN32 OR MINGW) -diff --git a/src/osgPlugins/gdal/CMakeLists.txt b/src/osgPlugins/gdal/CMakeLists.txt -index f1b670701..353bc9fc6 100644 ---- a/src/osgPlugins/gdal/CMakeLists.txt -+++ b/src/osgPlugins/gdal/CMakeLists.txt -@@ -9,7 +9,7 @@ SET(TARGET_H - DataSetLayer.h - ) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - SET(TARGET_ADDED_LIBRARIES osgTerrain ) - - IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -diff --git a/src/osgPlugins/gif/CMakeLists.txt b/src/osgPlugins/gif/CMakeLists.txt -index 0db0296cc..99d1e26dc 100644 ---- a/src/osgPlugins/gif/CMakeLists.txt -+++ b/src/osgPlugins/gif/CMakeLists.txt -@@ -1,7 +1,7 @@ - INCLUDE_DIRECTORIES( ${GIF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterGIF.cpp ) --SET(TARGET_LIBRARIES_VARS GIF_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GIF_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(gif) - -diff --git a/src/osgPlugins/gta/CMakeLists.txt b/src/osgPlugins/gta/CMakeLists.txt -index 2b910a628..16466fefc 100644 ---- a/src/osgPlugins/gta/CMakeLists.txt -+++ b/src/osgPlugins/gta/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GTA_INCLUDE_DIRS} ) - - SET(TARGET_SRC ReaderWriterGTA.cpp ) - --SET(TARGET_LIBRARIES_VARS GTA_LIBRARY) -+SET(TARGET_LIBRARIES_VARS GTA_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(gta) -diff --git a/src/osgPlugins/jp2/CMakeLists.txt b/src/osgPlugins/jp2/CMakeLists.txt -index b95537680..adcd84f64 100644 ---- a/src/osgPlugins/jp2/CMakeLists.txt -+++ b/src/osgPlugins/jp2/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${JASPER_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterJP2.cpp ) - --SET(TARGET_LIBRARIES_VARS JASPER_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JASPER_LIBRARIES ) - - IF(WIN32) - ADD_DEFINITIONS(-DJAS_WIN_MSVC_BUILD) -diff --git a/src/osgPlugins/jpeg/CMakeLists.txt b/src/osgPlugins/jpeg/CMakeLists.txt -index 7117713a0..2d290a29d 100644 ---- a/src/osgPlugins/jpeg/CMakeLists.txt -+++ b/src/osgPlugins/jpeg/CMakeLists.txt -@@ -5,6 +5,6 @@ SET(TARGET_SRC - ReaderWriterJPEG.cpp - ) - --SET(TARGET_LIBRARIES_VARS JPEG_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS JPEG_LIBRARIES ) - #### end var setup ### - SETUP_PLUGIN(jpeg) -diff --git a/src/osgPlugins/ogr/CMakeLists.txt b/src/osgPlugins/ogr/CMakeLists.txt -index 01b71e360..ea8b9706a 100644 ---- a/src/osgPlugins/ogr/CMakeLists.txt -+++ b/src/osgPlugins/ogr/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${GDAL_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterOGR.cpp) - --SET(TARGET_LIBRARIES_VARS GDAL_LIBRARY ) -+SET(TARGET_LIBRARIES_VARS GDAL_LIBRARIES ) - - IF(CMAKE_COMPILER_IS_GNUCXX) - # Remove -Wshadow flag as it barfs on ffmoeg headers -diff --git a/src/osgPlugins/png/CMakeLists.txt b/src/osgPlugins/png/CMakeLists.txt -index 33df903d2..c4a6a2acc 100644 ---- a/src/osgPlugins/png/CMakeLists.txt -+++ b/src/osgPlugins/png/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ENDIF() - - SET(TARGET_SRC ReaderWriterPNG.cpp ) --SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARIES ) -+SET(TARGET_LIBRARIES_VARS PNG_LIBRARIES ZLIB_LIBRARIES ) - - - #### end var setup ### -diff --git a/src/osgPlugins/tiff/CMakeLists.txt b/src/osgPlugins/tiff/CMakeLists.txt -index fc945d68e..6b856eab2 100644 ---- a/src/osgPlugins/tiff/CMakeLists.txt -+++ b/src/osgPlugins/tiff/CMakeLists.txt -@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${TIFF_INCLUDE_DIR} ) - - SET(TARGET_SRC ReaderWriterTIFF.cpp ) - --SET(TARGET_LIBRARIES_VARS TIFF_LIBRARY) -+SET(TARGET_LIBRARIES_VARS TIFF_LIBRARIES) - - #### end var setup ### - SETUP_PLUGIN(tiff) -diff --git a/src/osgPlugins/vnc/CMakeLists.txt b/src/osgPlugins/vnc/CMakeLists.txt -index 9a54b2bf2..49bb2dce4 100644 ---- a/src/osgPlugins/vnc/CMakeLists.txt -+++ b/src/osgPlugins/vnc/CMakeLists.txt -@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${LIBVNCSERVER_INCLUDE_DIR}) - SET(TARGET_EXTERNAL_LIBRARIES - ${LIBVNCCLIENT_LIBRARY} - ${ZLIB_LIBRARIES} -- ${JPEG_LIBRARY} ) -+ ${JPEG_LIBRARIES} ) - - SET(TARGET_ADDED_LIBRARIES osgWidget ) - --- -2.21.0.windows.1 - diff --git a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch b/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch deleted file mode 100644 index 19caf4dfed537..0000000000000 --- a/recipes/openscenegraph/all/patches/0004-Allow-explicit-control-of-plugins.patch +++ /dev/null @@ -1,259 +0,0 @@ -From 04859156034c6762338411d5f2c07d02d0a7b814 Mon Sep 17 00:00:00 2001 -From: "R. Andrew Ohana" -Date: Thu, 17 Sep 2020 17:25:12 -0700 -Subject: [PATCH 4/5] Allow explicit control of plugins - ---- - src/osgDB/CMakeLists.txt | 8 ++-- - src/osgPlugins/CMakeLists.txt | 58 ++++++++++++++--------------- - src/osgPlugins/curl/CMakeLists.txt | 4 +- - src/osgPlugins/dicom/CMakeLists.txt | 2 +- - src/osgPlugins/ive/CMakeLists.txt | 2 +- - 5 files changed, 37 insertions(+), 37 deletions(-) - -diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt -index 340aae095..59b8b3a0d 100644 ---- a/src/osgDB/CMakeLists.txt -+++ b/src/osgDB/CMakeLists.txt -@@ -147,19 +147,19 @@ IF(AV_FOUNDATION_FOUND) - ADD_DEFINITIONS(-DUSE_AV_FOUNDATION) - ENDIF() - --IF(FFMPEG_FOUND) -+IF(OSG_WITH_FFMPEG) - ADD_DEFINITIONS(-DUSE_FFMPEG) - ENDIF() - --IF(INVENTOR_FOUND) -+IF(OSG_WITH_INVENTOR) - ADD_DEFINITIONS(-DUSE_INVENTOR) - ENDIF() - --IF(OPENVRML_FOUND) -+IF(OSG_WITH_OPENVRML) - ADD_DEFINITIONS(-DUSE_VRML) - ENDIF() - --IF( ZLIB_FOUND ) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS( -DUSE_ZLIB ) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR} ) - SET(COMPRESSION_LIBRARIES ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt -index 2a88684b5..24dc68667 100644 ---- a/src/osgPlugins/CMakeLists.txt -+++ b/src/osgPlugins/CMakeLists.txt -@@ -99,29 +99,29 @@ ADD_PLUGIN_DIRECTORY(dot) - ADD_PLUGIN_DIRECTORY(vtf) - ADD_PLUGIN_DIRECTORY(ktx) - --IF(JPEG_FOUND) -+IF(OSG_WITH_JPEG) - ADD_PLUGIN_DIRECTORY(jpeg) - ENDIF() --IF(JASPER_FOUND) -+IF(OSG_WITH_JASPER) - ADD_PLUGIN_DIRECTORY(jp2) - ENDIF() --IF(OPENEXR_FOUND AND ZLIB_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_OPENEXR) - ADD_PLUGIN_DIRECTORY(exr) - ENDIF() --IF(GIF_FOUND) -+IF(OSG_WITH_GIF) - ADD_PLUGIN_DIRECTORY(gif) - ENDIF() --IF(PNG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_PNG) - ADD_PLUGIN_DIRECTORY(png) - ENDIF() --IF(TIFF_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_TIFF) - ADD_PLUGIN_DIRECTORY(tiff) - ENDIF() --IF(GDAL_FOUND) -+IF(OSG_WITH_GDAL) - ADD_PLUGIN_DIRECTORY(gdal) - ADD_PLUGIN_DIRECTORY(ogr) - ENDIF() --IF(GTA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_GTA) - ADD_PLUGIN_DIRECTORY(gta) - ENDIF() - -@@ -130,9 +130,9 @@ ENDIF() - # - # 3D Image plugins - # --IF(DCMTK_FOUND AND ZLIB_FOUND) -+IF(OSG_WITH_DCMTK) - ADD_PLUGIN_DIRECTORY(dicom) --ELSE() -+ELSEIF(FALSE) - IF(ITK_FOUND) - ADD_PLUGIN_DIRECTORY(dicom) - ENDIF() -@@ -147,29 +147,29 @@ ADD_PLUGIN_DIRECTORY(3dc) - - ADD_PLUGIN_DIRECTORY(p3d) - --IF(CURL_FOUND) -+IF(OSG_WITH_CURL) - ADD_PLUGIN_DIRECTORY(curl) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(gz) - ENDIF() - - IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE) -- IF(INVENTOR_FOUND) -+ IF(OSG_WITH_INVENTOR) - ADD_PLUGIN_DIRECTORY(Inventor) - ENDIF() - ENDIF() - --IF(COLLADA_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_COLLADA) - ADD_PLUGIN_DIRECTORY(dae) - ENDIF() - --IF(FBX_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FBX) - ADD_PLUGIN_DIRECTORY(fbx) - ENDIF() - --IF(OPENCASCADE_FOUND) -+IF(OSG_WITH_OPENCASCADE) - ADD_PLUGIN_DIRECTORY(OpenCASCADE) - ENDIF() - -@@ -209,15 +209,15 @@ IF(OSG_CPP_EXCEPTIONS_AVAILABLE) - ADD_PLUGIN_DIRECTORY(txp) - ENDIF() - --IF(FFMPEG_FOUND AND OSG_CPP_EXCEPTIONS_AVAILABLE) -+IF(OSG_WITH_FFMPEG) - ADD_PLUGIN_DIRECTORY(ffmpeg) - ENDIF() - --IF(GSTREAMER_FOUND AND GLIB_FOUND) -+IF(OSG_WITH_GSTREAMER) - ADD_PLUGIN_DIRECTORY(gstreamer) - ENDIF() - --IF(DIRECTSHOW_FOUND) -+IF(OSG_WITH_DIRECTSHOW) - ADD_PLUGIN_DIRECTORY(directshow) - ENDIF() - -@@ -241,28 +241,28 @@ IF(QTKIT_FOUND) - ADD_PLUGIN_DIRECTORY(QTKit) - ENDIF() - --IF(NVTT_FOUND) -+IF(OSG_WITH_NVTT) - ADD_PLUGIN_DIRECTORY(nvtt) - ENDIF() - - --IF(FREETYPE_FOUND) -+IF(OSG_WITH_FREETYPE) - ADD_PLUGIN_DIRECTORY(freetype) - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_PLUGIN_DIRECTORY(zip) - ENDIF() - --IF(RSVG_FOUND) -+IF(OSG_WITH_RSVG) - ADD_PLUGIN_DIRECTORY(svg) - ENDIF() - --IF(POPPLER_FOUND) -+IF(OSG_WITH_POPPLER) - ADD_PLUGIN_DIRECTORY(pdf) - ENDIF() - --IF(LIBVNCSERVER_FOUND) -+IF(OSG_WITH_LIBVNCSERVER) - ADD_PLUGIN_DIRECTORY(vnc) - ENDIF() - -@@ -272,7 +272,7 @@ ADD_PLUGIN_DIRECTORY(osc) - ADD_PLUGIN_DIRECTORY(trk) - ADD_PLUGIN_DIRECTORY(tf) - --IF(LIBLAS_FOUND) -+IF(OSG_WITH_LIBLAS) - ADD_PLUGIN_DIRECTORY(las) - ENDIF() - -@@ -299,16 +299,16 @@ ENDIF() - # - # Device integration plugins - # --IF (SDL_FOUND) -+IF(OSG_WITH_SDL) - ADD_PLUGIN_DIRECTORY(sdl) - ENDIF(SDL_FOUND) - --IF(ASIO_FOUND) -+IF(OSG_WITH_ASIO) - ADD_PLUGIN_DIRECTORY(RestHttpDevice) - ENDIF(ASIO_FOUND) - - --IF(ZEROCONF_FOUND) -+IF(OSG_WITH_ZEROCONF) - ADD_PLUGIN_DIRECTORY(ZeroConfDevice) - ENDIF() - -diff --git a/src/osgPlugins/curl/CMakeLists.txt b/src/osgPlugins/curl/CMakeLists.txt -index 4afb738c7..fb5b98498 100644 ---- a/src/osgPlugins/curl/CMakeLists.txt -+++ b/src/osgPlugins/curl/CMakeLists.txt -@@ -5,7 +5,7 @@ IF(WIN32) - SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT") - ENDIF() - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${CURL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) - ELSE() -@@ -21,7 +21,7 @@ SET(TARGET_H - ReaderWriterCURL.h - ) - --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - SET(TARGET_LIBRARIES_VARS - CURL_LIBRARIES - ZLIB_LIBRARIES) -diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt -index 3f159a9c5..06ccd17ed 100644 ---- a/src/osgPlugins/dicom/CMakeLists.txt -+++ b/src/osgPlugins/dicom/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF (DCMTK_FOUND) -+IF (TRUE) - - # note, we have to include a '/' in front of the directory string to prevent a CMake bug from ignoring the directory - INCLUDE_DIRECTORIES(${DCMTK_INCLUDE_DIRS}) -diff --git a/src/osgPlugins/ive/CMakeLists.txt b/src/osgPlugins/ive/CMakeLists.txt -index 784a79c7e..40030b27d 100644 ---- a/src/osgPlugins/ive/CMakeLists.txt -+++ b/src/osgPlugins/ive/CMakeLists.txt -@@ -1,4 +1,4 @@ --IF(ZLIB_FOUND) -+IF(OSG_WITH_ZLIB) - ADD_DEFINITIONS(-DUSE_ZLIB) - INCLUDE_DIRECTORIES( ${ZLIB_INCLUDE_DIR}) - ENDIF() --- -2.21.0.windows.1 - From ba49b3702f5c20a7ff6603c5fec2fb322e941093 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 7 Aug 2023 14:26:32 +0300 Subject: [PATCH 03/45] openscenegraph: bump deps --- recipes/openscenegraph/all/conanfile.py | 14 +++++++------- .../openscenegraph/all/test_package/conanfile.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 90f1283ae7383..b21c7416bde87 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -123,16 +123,16 @@ def requirements(self): if self.options.get_safe("with_asio", False): # Should these be private requires? - self.requires("asio/1.28.0") - self.requires("boost/1.82.0") + self.requires("asio/1.28.2") + self.requires("boost/1.83.0") if self.options.with_curl: - self.requires("libcurl/8.2.0") + self.requires("libcurl/8.4.0") if self.options.get_safe("with_dcmtk"): self.requires("dcmtk/3.6.7") if self.options.with_freetype: self.requires("freetype/2.13.0") if self.options.with_gdal: - self.requires("gdal/3.5.2") + self.requires("gdal/3.7.0") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: @@ -142,13 +142,13 @@ def requirements(self): if self.options.get_safe("with_jpeg"): self.requires("libjpeg/9e") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.1") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.with_tiff: - self.requires("libtiff/4.5.1") + self.requires("libtiff/4.6.0") if self.options.with_zlib: - self.requires("zlib/1.2.13") + self.requires("zlib/[>=1.2.11 <2]") def validate(self): if self.options.get_safe("with_asio", False): diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index e8d87cadb7e1e..d4adf5acd4f9a 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -7,7 +7,7 @@ class TestPackageConan(ConanFile): settings = "os", "arch", "compiler", "build_type" - generators = "CMakeDeps", "VirtualRunEnv" + generators = "CMakeDeps", "VirtualRunEnv" test_type = "explicit" def requirements(self): From d5921af2655e108475c9f90d15c5412ea3b451a7 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 20:15:48 +0200 Subject: [PATCH 04/45] openscenegraph: further migration --- recipes/openscenegraph/all/conandata.yml | 4 +- recipes/openscenegraph/all/conanfile.py | 47 ++++++++++--------- .../all/test_package/conanfile.py | 8 ++-- 3 files changed, 31 insertions(+), 28 deletions(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index b834a7df8daac..0c500d2e2201c 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -1,7 +1,7 @@ sources: 3.6.5: - sha256: aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12 - url: https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz + url: "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz" + sha256: "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" patches: 3.6.5: - patch_file: patches/0005-use-JPEG-target-for-plugin.patch diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index b21c7416bde87..8994ba89e410c 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -121,16 +121,16 @@ def requirements(self): if self.options.use_fontconfig: self.requires("fontconfig/2.14.2") - if self.options.get_safe("with_asio", False): + if self.options.get_safe("with_asio"): # Should these be private requires? self.requires("asio/1.28.2") self.requires("boost/1.83.0") if self.options.with_curl: - self.requires("libcurl/8.4.0") + self.requires("libcurl/[>=7.78.0 <9]") if self.options.get_safe("with_dcmtk"): self.requires("dcmtk/3.6.7") if self.options.with_freetype: - self.requires("freetype/2.13.0") + self.requires("freetype/2.13.2") if self.options.with_gdal: self.requires("gdal/3.7.0") if self.options.get_safe("with_gif"): @@ -151,7 +151,7 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") def validate(self): - if self.options.get_safe("with_asio", False): + if self.options.get_safe("with_asio"): raise ConanInvalidConfiguration( "ASIO support in OSG is broken, " "see https://github.com/openscenegraph/OpenSceneGraph/issues/921" @@ -235,10 +235,10 @@ def generate(self): deps.generate() def _patch_sources(self): - for package in ("Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"): + for package in ["Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"]: # Prefer conan's find package scripts over osg's os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) - for path in (self.source_path / "src" / "osgPlugins").rglob("CMakeLists.txt"): + for path in self.source_path.joinpath("src", "osgPlugins").rglob("CMakeLists.txt"): content = path.read_text() # Correct usage of *_LIBRARY variables to *_LIBRARIES content = content.replace("_LIBRARY", "_LIBRARIES") @@ -247,7 +247,7 @@ def _patch_sources(self): content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) path.write_text(content) # Fix file(to_cmake_path ...) usage - path = self.source_path / "CMakeModules" / "OsgMacroUtils.cmake" + path = self.source_path.joinpath("CMakeModules", "OsgMacroUtils.cmake") content = path.read_text() content = re.sub(r'FILE\(TO_CMAKE_PATH TMPVAR "CMAKE_(\w+)_OUTPUT_DIRECTORY/\$\{RELATIVE_OUTDIR}"\)', r'FILE(TO_CMAKE_PATH "\${CMAKE_\1_OUTPUT_DIRECTORY}/\${RELATIVE_OUTDIR}" TMPVAR)', @@ -255,6 +255,10 @@ def _patch_sources(self): path.write_text(content) apply_conandata_patches(self) + # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), + "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") + def build(self): self._patch_sources() cmake = CMake(self) @@ -399,7 +403,7 @@ def setup_library(lib): setup_plugin("osg") plugin = setup_plugin("ive") - plugin.requires.extend(("osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume")) + plugin.requires.extend(["osgSim", "osgFX", "osgText", "osgTerrain", "osgVolume"]) if self.options.with_zlib: plugin.requires.append("zlib::zlib") @@ -433,13 +437,13 @@ def setup_library(lib): setup_plugin("gif").requires.append("giflib::giflib") if self.options.get_safe("with_png"): - setup_plugin("png").requires.extend(("libpng::libpng", "zlib::zlib")) + setup_plugin("png").requires.extend(["libpng::libpng", "zlib::zlib"]) if self.options.with_tiff: setup_plugin("tiff").requires.append("libtiff::libtiff") if self.options.with_gdal: - setup_plugin("gdal").requires.extend(("osgTerrain", "gdal::gdal")) + setup_plugin("gdal").requires.extend(["osgTerrain", "gdal::gdal"]) setup_plugin("ogr").requires.append("gdal::gdal") if self.options.with_gta: @@ -448,13 +452,13 @@ def setup_library(lib): # 3D Image plugins if self.options.get_safe("with_dcmtk"): plugin = setup_plugin("dicom") - plugin.requires.extend(("osgVolume", "dcmtk::dcmtk")) + plugin.requires.extend(["osgVolume", "dcmtk::dcmtk"]) if self.settings.os == "Windows": plugin.system_libs = ["wsock32", "ws2_32"] # 3rd party 3d plugins setup_plugin("3dc") - setup_plugin("p3d").requires.extend(("osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation")) + setup_plugin("p3d").requires.extend(["osgGA", "osgText", "osgVolume", "osgFX", "osgViewer", "osgPresentation"]) if self.options.with_curl: plugin = setup_plugin("curl") @@ -492,15 +496,15 @@ def setup_library(lib): setup_plugin("md2") setup_plugin("osgtgz") setup_plugin("tgz") - setup_plugin("shp").requires.extend(("osgSim", "osgTerrain")) + setup_plugin("shp").requires.extend(["osgSim", "osgTerrain"]) setup_plugin("txf").requires.append("osgText") setup_plugin("bsp") setup_plugin("mdl") - setup_plugin("gles").requires.extend(("osgUtil", "osgAnimation")) - setup_plugin("osgjs").requires.extend(("osgAnimation", "osgSim")) + setup_plugin("gles").requires.extend(["osgUtil", "osgAnimation"]) + setup_plugin("osgjs").requires.extend(["osgAnimation", "osgSim"]) setup_plugin("lwo").requires.append("osgFX") setup_plugin("ply") - setup_plugin("txp").requires.extend(("osgSim", "osgText")) + setup_plugin("txp").requires.extend(["osgSim", "osgText"]) # with_ffmpeg # setup_plugin("ffmpeg") @@ -515,10 +519,9 @@ def setup_library(lib): setup_plugin("imageio").frameworks = ["Accelerate"] if ( - is_apple_os(self) - and self.settings.os.version - and Version(self.settings.os.version) >= "10.8" - ) or (self.settings.os == "iOS" and Version(self.settings.os.version) >= "6.0"): + (self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") or + (self.settings.os == "iOS" and self.settings.os.version and Version(self.settings.os.version) >= "6.0") + ): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] @@ -540,7 +543,7 @@ def setup_library(lib): # setup_plugin("nvtt") if self.options.with_freetype: - setup_plugin("freetype").requires.extend(("osgText", "freetype::freetype")) + setup_plugin("freetype").requires.extend(["osgText", "freetype::freetype"]) if self.options.with_zlib: setup_plugin("zip") @@ -573,7 +576,7 @@ def setup_library(lib): # setup_plugin("sdl") if self.options.get_safe("with_asio", False): - setup_plugin("resthttp").requires.extend(("osgPresentation", "asio::asio", "boost::boost")) + setup_plugin("resthttp").requires.extend(["osgPresentation", "asio::asio", "boost::boost"]) # with_zeroconf # setup_plugin("zeroconf") diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index d4adf5acd4f9a..3b3bb4e747cb4 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -20,11 +20,11 @@ def generate(self): tc = CMakeToolchain(self) for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): - tc.variables["OSG_HAS_" + key.upper()] = 1 if value else 0 + tc.preprocessor_definitions[key.upper()] = 1 if value == "True" else 0 if is_apple_os(self): - tc.variables["OSG_HAS_WITH_GIF"] = 0 - tc.variables["OSG_HAS_WITH_JPEG"] = 0 - tc.variables["OSG_HAS_WITH_PNG"] = 0 + tc.preprocessor_definitions["WITH_GIF"] = 0 + tc.preprocessor_definitions["WITH_JPEG"] = 0 + tc.preprocessor_definitions["WITH_PNG"] = 0 tc.generate() def build(self): From b6079cdfc6c0c39820647afc87f25f45bfb1cd90 Mon Sep 17 00:00:00 2001 From: Petukhov Maksim Date: Sat, 22 Jul 2023 00:38:50 +0300 Subject: [PATCH 05/45] fix --- recipes/openscenegraph/all/conandata.yml | 10 ++- recipes/openscenegraph/all/conanfile.py | 18 +++-- .../0007-fix-msvc-with-std-c++17.patch | 50 +++++++++++++ .../patches/0008-replace-mem-fun-ref.patch | 13 ++++ .../0009-replace-auto-ptr-in-plugins.patch | 75 +++++++++++++++++++ .../0010-replace-ptr-fun-in-obj-plugin.patch | 24 ++++++ 6 files changed, 184 insertions(+), 6 deletions(-) create mode 100644 recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch create mode 100644 recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch create mode 100644 recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch create mode 100644 recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 0c500d2e2201c..5763af16bb223 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -4,5 +4,13 @@ sources: sha256: "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" patches: 3.6.5: - - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch + base_path: source_subfolder + - patch_file: patches/0007-fix-msvc-with-std-c++17.patch + base_path: source_subfolder + - patch_file: patches/0008-replace-mem-fun-ref.patch + base_path: source_subfolder + - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch + base_path: source_subfolder + - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch + base_path: source_subfolder diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 8994ba89e410c..1a503055d1e14 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -43,7 +43,7 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": [True, False], "with_gta": [True, False], "with_jasper": [True, False], - "with_jpeg": [True, False], + "with_jpeg": ["libjpeg", "libjpeg-turbo", "mozjpeg", False], "with_openexr": [True, False], "with_png": [True, False], "with_tiff": [True, False], @@ -71,7 +71,7 @@ class OpenSceneGraphConanFile(ConanFile): "with_gif": True, "with_gta": False, "with_jasper": False, - "with_jpeg": True, + "with_jpeg": "libjpeg", "with_openexr": False, "with_png": True, "with_tiff": True, @@ -139,12 +139,16 @@ def requirements(self): self.requires("libgta/1.2.1") if self.options.with_jasper: self.requires("jasper/4.0.0") - if self.options.get_safe("with_jpeg"): + if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + self.requires("libjpeg-turbo/2.1.5") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + self.requires("mozjpeg/4.1.1") if self.options.get_safe("with_openexr"): self.requires("openexr/3.2.1") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.40") + self.requires("libpng/1.6.39") if self.options.with_tiff: self.requires("libtiff/4.6.0") if self.options.with_zlib: @@ -424,8 +428,12 @@ def setup_library(lib): setup_plugin("vtf") setup_plugin("ktx") - if self.options.get_safe("with_jpeg"): + if self.options.get_safe("with_jpeg") == "libjpeg": setup_plugin("jpeg").requires.append("libjpeg::libjpeg") + elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": + setup_plugin("jpeg").requires.append("libjpeg-turbo::jpeg") + elif self.options.get_safe("with_jpeg") == "mozjpeg": + setup_plugin("jpeg").requires.append("mozjpeg::libjpeg") if self.options.with_jasper: setup_plugin("jp2").requires.append("jasper::jasper") diff --git a/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch new file mode 100644 index 0000000000000..39046ed3994aa --- /dev/null +++ b/recipes/openscenegraph/all/patches/0007-fix-msvc-with-std-c++17.patch @@ -0,0 +1,50 @@ +diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp +index 5c699c8b0..5c097cf66 100644 +--- a/src/osg/DisplaySettings.cpp ++++ b/src/osg/DisplaySettings.cpp +@@ -22,9 +22,6 @@ + #include + #include + +-using namespace osg; +-using namespace std; +- + #if defined(WIN32) && !defined(__CYGWIN__) + #include + extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } +@@ -32,6 +29,9 @@ extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; } + extern "C" { int NvOptimusEnablement=0x00000001; } + #endif + ++using namespace osg; ++using namespace std; ++ + void DisplaySettings::setNvOptimusEnablement(int value) + { + NvOptimusEnablement = value; +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..4247cc2af 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -235,7 +235,7 @@ + #include "CameraConfig.h" + + +-using namespace std; ++ + using namespace osgProducer; + + static void ConfigParser_error( const char * ); +diff --git a/src/osgPlugins/cfg/ConfigParser.y b/src/osgPlugins/cfg/ConfigParser.y +index cf9adf507..5221be184 100644 +--- a/src/osgPlugins/cfg/ConfigParser.y ++++ b/src/osgPlugins/cfg/ConfigParser.y +@@ -34,7 +34,7 @@ + #include + + +-using namespace std; ++ + using namespace Producer; + + static void ConfigParser_error( const char * ); diff --git a/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch new file mode 100644 index 0000000000000..5f86f332a80cf --- /dev/null +++ b/recipes/openscenegraph/all/patches/0008-replace-mem-fun-ref.patch @@ -0,0 +1,13 @@ +diff --git a/src/osgUtil/tristripper/include/detail/graph_array.h b/src/osgUtil/tristripper/include/detail/graph_array.h +index dc1f38027..ce7000cc8 100644 +--- a/src/osgUtil/tristripper/include/detail/graph_array.h ++++ b/src/osgUtil/tristripper/include/detail/graph_array.h +@@ -446,7 +446,7 @@ inline void graph_array::swap(graph_type & Right) + template + inline void unmark_nodes(graph_array & G) + { +- std::for_each(G.begin(), G.end(), std::mem_fun_ref(&graph_array::node::unmark)); ++ for(typename graph_array::node_iterator itr = G.begin(); itr != G.end(); ++itr) itr->unmark(); + } + + diff --git a/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch new file mode 100644 index 0000000000000..fcd865d09b2d6 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch @@ -0,0 +1,75 @@ +diff --git a/src/osgPlugins/dae/ReaderWriterDAE.cpp b/src/osgPlugins/dae/ReaderWriterDAE.cpp +index fc1a448d4..3b883f19a 100644 +--- a/src/osgPlugins/dae/ReaderWriterDAE.cpp ++++ b/src/osgPlugins/dae/ReaderWriterDAE.cpp +@@ -32,7 +32,7 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + +-#if __cplusplus > 199711L ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) + #define smart_ptr std::unique_ptr + #else + #define smart_ptr std::auto_ptr +diff --git a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +index 69826c456..9bba5532a 100644 +--- a/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp ++++ b/src/osgPlugins/ffmpeg/FFmpegImageStream.cpp +@@ -10,6 +10,11 @@ + + #define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10 + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ #define smart_ptr std::unique_ptr ++#else ++ #define smart_ptr std::auto_ptr ++#endif + + namespace osgFFmpeg { + +@@ -23,8 +28,8 @@ FFmpegImageStream::FFmpegImageStream() : + { + setOrigin(osg::Image::TOP_LEFT); + +- std::auto_ptr decoder(new FFmpegDecoder); +- std::auto_ptr commands(new CommandQueue); ++ smart_ptr decoder(new FFmpegDecoder); ++ smart_ptr commands(new CommandQueue); + + m_decoder = decoder.release(); + m_commands = commands.release(); +diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +index 298e02fcc..113c9c45f 100644 +--- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp ++++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +@@ -34,6 +34,12 @@ + + #define SERIALIZER() OpenThreads::ScopedLock lock(_serializerMutex) + ++#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) ++ #define smart_ptr std::unique_ptr ++#else ++ #define smart_ptr std::auto_ptr ++#endif ++ + // From easyrgb.com + float Hue_2_RGB( float v1, float v2, float vH ) + { +@@ -123,7 +129,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); +@@ -577,7 +583,7 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter + + initGDAL(); + +- std::auto_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); ++ smart_ptr dataset((GDALDataset*)GDALOpen(fileName.c_str(),GA_ReadOnly)); + if (!dataset.get()) return ReadResult::FILE_NOT_HANDLED; + + int dataWidth = dataset->GetRasterXSize(); diff --git a/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch new file mode 100644 index 0000000000000..139031361bc28 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0010-replace-ptr-fun-in-obj-plugin.patch @@ -0,0 +1,24 @@ +diff --git a/src/osgPlugins/obj/obj.cpp b/src/osgPlugins/obj/obj.cpp +index 859add652..3580e5181 100644 +--- a/src/osgPlugins/obj/obj.cpp ++++ b/src/osgPlugins/obj/obj.cpp +@@ -37,10 +37,15 @@ using namespace obj; + + static std::string strip( const std::string& ss ) + { +- std::string result; +- result.assign( std::find_if( ss.begin(), ss.end(), std::not1( std::ptr_fun< int, int >( isspace ) ) ), +- std::find_if( ss.rbegin(), ss.rend(), std::not1( std::ptr_fun< int, int >( isspace ) ) ).base() ); +- return( result ); ++ std::string::const_iterator it = ss.begin(); ++ while (it != ss.end() && isspace(*it)) ++ it++; ++ ++ std::string::const_reverse_iterator rit = ss.rbegin(); ++ while (rit.base() != it && isspace(*rit)) ++ rit++; ++ ++ return std::string(it, rit.base()); + } + + /* From 9bacc460586e0dc2657237ad2818c8d80d268b82 Mon Sep 17 00:00:00 2001 From: Maksim Petukhov <6967052+maksim-petukhov@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:01:01 +0100 Subject: [PATCH 06/45] Apply suggestions from code review --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 1a503055d1e14..65e3ce3c90b8f 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -126,7 +126,7 @@ def requirements(self): self.requires("asio/1.28.2") self.requires("boost/1.83.0") if self.options.with_curl: - self.requires("libcurl/[>=7.78.0 <9]") + self.requires("libcurl/[>=7.78 <9]") if self.options.get_safe("with_dcmtk"): self.requires("dcmtk/3.6.7") if self.options.with_freetype: From 6445d2eee2aff2f28dcadd5cbc9f73287ef3afc6 Mon Sep 17 00:00:00 2001 From: Petukhov Maksim Date: Fri, 3 Nov 2023 16:30:02 +0300 Subject: [PATCH 07/45] review --- recipes/openscenegraph/all/conandata.yml | 8 ++++++++ recipes/openscenegraph/all/conanfile.py | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 5763af16bb223..57b5dc0002083 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -8,9 +8,17 @@ patches: base_path: source_subfolder - patch_file: patches/0007-fix-msvc-with-std-c++17.patch base_path: source_subfolder + patch_type: bugfix + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1055 - patch_file: patches/0008-replace-mem-fun-ref.patch base_path: source_subfolder + patch_type: bugfix + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/8a0114a46a4bad9041297950fe3bfbb2aea6e1da - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch base_path: source_subfolder + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch base_path: source_subfolder + patch_type: portability + patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 65e3ce3c90b8f..b47e085def2e9 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -142,13 +142,13 @@ def requirements(self): if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": - self.requires("libjpeg-turbo/2.1.5") + self.requires("libjpeg-turbo/3.0.0") elif self.options.get_safe("with_jpeg") == "mozjpeg": - self.requires("mozjpeg/4.1.1") + self.requires("mozjpeg/4.1.3") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.2.1") + self.requires("openexr/3.1.9") if self.options.get_safe("with_png"): - self.requires("libpng/1.6.39") + self.requires("libpng/1.6.40") if self.options.with_tiff: self.requires("libtiff/4.6.0") if self.options.with_zlib: From 1e7af9180ebee2bac58959cc4c272e022b2969b4 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 4 Dec 2023 16:00:11 +0200 Subject: [PATCH 08/45] openscenegraph: bump deps --- recipes/openscenegraph/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index b47e085def2e9..b3a8a45639efe 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -132,19 +132,19 @@ def requirements(self): if self.options.with_freetype: self.requires("freetype/2.13.2") if self.options.with_gdal: - self.requires("gdal/3.7.0") + self.requires("gdal/3.8.0") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_jasper: - self.requires("jasper/4.0.0") + self.requires("jasper/4.1.0") if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": self.requires("libjpeg-turbo/3.0.0") elif self.options.get_safe("with_jpeg") == "mozjpeg": - self.requires("mozjpeg/4.1.3") + self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_openexr"): self.requires("openexr/3.1.9") if self.options.get_safe("with_png"): From 86f09a3bc00cf66141bb553ca5ceb3cd83e12270 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 4 Dec 2023 17:08:49 +0200 Subject: [PATCH 09/45] openscenegraph: make CMake dependency detection more robust --- recipes/openscenegraph/all/CMakeLists.txt | 45 +++++++++++++++++++ recipes/openscenegraph/all/conanfile.py | 4 +- .../all/test_package/conanfile.py | 2 +- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 recipes/openscenegraph/all/CMakeLists.txt diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt new file mode 100644 index 0000000000000..77f53647eabb7 --- /dev/null +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.15) +project(cmake_wrapper) + +macro(custom_find_package name variable) + string(TOUPPER ${name} name_upper) + if(${variable}) + find_package(${name} ${ARGN} REQUIRED CONFIG + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + set(${name_upper}_FOUND TRUE) + set(${name_upper}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${name_upper}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${name_upper}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${name_upper}_LIBRARIES ${${name}_LIBRARIES}) + set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) + unset(name_upper) + else() + set(CMAKE_DISABLE_FIND_PACKAGE_${name} TRUE) + set(${name}_FOUND FALSE) + set(${name_upper}_FOUND FALSE) + endif() +endmacro() + +custom_find_package(Boost OSG_WITH_ASIO) +custom_find_package(Asio OSG_WITH_ASIO) +custom_find_package(CURL OSG_WITH_CURL) +custom_find_package(Fontconfig OSG_TEXT_USE_FONTCONFIG) +custom_find_package(Freetype OSG_WITH_FREETYPE) +custom_find_package(GDAL OSG_WITH_GDAL) +custom_find_package(GIFLIB OSG_WITH_GIFLIB) +custom_find_package(GTA OSG_WITH_GTA) +custom_find_package(JPEG OSG_WITH_JPEG) +custom_find_package(Jasper OSG_WITH_JASPER) +custom_find_package(OpenEXR OSG_WITH_OPENEXR) +custom_find_package(PNG OSG_WITH_PNG) +custom_find_package(TIFF OSG_WITH_TIFF) +custom_find_package(ZLIB OSG_WITH_ZLIB) +custom_find_package(DCMTK OSG_WITH_DCMTK) +# custom_find_package(Poppler) +# custom_find_package(RSVG) +# custom_find_package(SDL2) + +add_subdirectory(src) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index b3a8a45639efe..e6af7caf78d76 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -234,7 +234,7 @@ def generate(self): tc.generate() deps = CMakeDeps(self) - deps.set_property("freetype", "cmake_module_file_name", "FREETYPE") + deps.set_property("freetype", "cmake_module_file_name", "Freetype") deps.set_property("giflib", "cmake_file_name", "GIFLIB") deps.generate() @@ -266,7 +266,7 @@ def _patch_sources(self): def build(self): self._patch_sources() cmake = CMake(self) - cmake.configure() + cmake.configure(build_script_folder=self.source_path.parent) cmake.build() def package(self): diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index 3b3bb4e747cb4..6ce3e56d71a81 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -20,7 +20,7 @@ def generate(self): tc = CMakeToolchain(self) for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): - tc.preprocessor_definitions[key.upper()] = 1 if value == "True" else 0 + tc.preprocessor_definitions[key.upper()] = 1 if str(value) != "False" else 0 if is_apple_os(self): tc.preprocessor_definitions["WITH_GIF"] = 0 tc.preprocessor_definitions["WITH_JPEG"] = 0 From 40ffca905673c6902afb13f8b1c72e5c8d5436ff Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 3 Jan 2024 00:20:02 +0200 Subject: [PATCH 10/45] openscenegraph: fix CMake target name --- recipes/openscenegraph/all/conanfile.py | 15 ++++++--------- .../all/test_package/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index e6af7caf78d76..f88fe331aec80 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -279,23 +279,20 @@ def package(self): rm(self, "*.pdb", self.package_folder, True) def package_info(self): - # FindOpenSceneGraph.cmake is shipped with cmake and is a traditional cmake script + # FIXME: FindOpenSceneGraph.cmake is shipped with cmake and is a traditional cmake script + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in # It doesn't setup targets and only provides a few variables: # - OPENSCENEGRAPH_FOUND # - OPENSCENEGRAPH_VERSION # - OPENSCENEGRAPH_INCLUDE_DIRS # - OPENSCENEGRAPH_LIBRARIES - # Unfortunately, the cmake_find_package generators don't currently allow directly setting variables, - # but it will set the last three of these if the name of the package is OPENSCENEGRAPH (it uses - # the filename for the first, so OpenSceneGraph_FOUND gets set, not OPENSCENEGRAPH_FOUND) + self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") - self.cpp_info.set_property("cmake_target_name", "OPENSCENEGRAPH::OPENSCENEGRAPH") + self.cpp_info.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" - self.cpp_info.names["cmake_find_package"] = "OPENSCENEGRAPH" - self.cpp_info.names["cmake_find_package_multi"] = "OPENSCENEGRAPH" + self.cpp_info.names["cmake_find_package"] = "OpenSceneGraph" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSceneGraph" if self.settings.build_type == "Debug": postfix = "d" diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index 7512bd4b87abc..35a7711fbf791 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -11,4 +11,4 @@ foreach(cache_variable ${cache_variables}) endforeach() add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OPENSCENEGRAPH::OPENSCENEGRAPH) +target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph) From 516cc53eb5097004355839c3451b3c94b93a6a03 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 3 Jan 2024 17:04:31 +0200 Subject: [PATCH 11/45] openscenegraph: fix v1 build --- recipes/openscenegraph/all/test_package/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index 35a7711fbf791..679e470165253 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) -find_package(OpenSceneGraph REQUIRED) +find_package(OpenSceneGraph REQUIRED CONFIG) get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) foreach(cache_variable ${cache_variables}) From ee1e5a7bf8b7b274f741ab2eda9637f9b958ceb2 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 3 Jan 2024 18:58:32 +0200 Subject: [PATCH 12/45] openscenegraph: reproduce the project CMake and pkg-config structures more faithfully, export CMake vars --- .../all/conan-official-osg-variables.cmake | 23 +++++++ recipes/openscenegraph/all/conanfile.py | 63 +++++++++++++++---- 2 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 recipes/openscenegraph/all/conan-official-osg-variables.cmake diff --git a/recipes/openscenegraph/all/conan-official-osg-variables.cmake b/recipes/openscenegraph/all/conan-official-osg-variables.cmake new file mode 100644 index 0000000000000..636f54b308c40 --- /dev/null +++ b/recipes/openscenegraph/all/conan-official-osg-variables.cmake @@ -0,0 +1,23 @@ +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in +# Component-specific variables are not created. Use the component targets instead. + +# Only export these for the OpenSceneGraph config file, not FindOSG.cmake +if(NOT DEFINED OSG_LIBRARIES) + set(OPENSCENEGRAPH_FOUND TRUE) + set(OPENSCENEGRAPH_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OPENSCENEGRAPH_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OPENSCENEGRAPH_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) + + set(OPENSCENEGRAPH_VERSION ${OpenSceneGraph_VERSION}) + set(OPENSCENEGRAPH_VERSION_STRING ${OpenSceneGraph_VERSION_STRING}) + + set(OSG_LIBRARY ${OpenSceneGraph_LIBRARIES}) + set(OSG_LIBRARIES ${OpenSceneGraph_LIBRARIES}) + set(OSG_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) + set(OSG_INCLUDE_DIRS ${OpenSceneGraph_INCLUDE_DIRS}) +endif() + +# Reproduce https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake +set(OPENTHREADS_FOUND TRUE) +set(OPENTHREADS_INCLUDE_DIR ${OpenSceneGraph_INCLUDE_DIRS}) +set(OPENTHREADS_LIBRARY OpenThreads::OpenThreads) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index f88fe331aec80..219a12aa1ec10 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -80,7 +80,8 @@ class OpenSceneGraphConanFile(ConanFile): } def export_sources(self): - copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder) + copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) + copy(self, "conan-official-osg-variables.cmake", self.recipe_folder, self.export_sources_folder) export_conandata_patches(self) def config_options(self): @@ -274,25 +275,58 @@ def package(self): cmake.install() copy(self, "LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + copy(self, "conan-official-osg-variables.cmake", + dst=os.path.join(self.package_folder, "lib", "cmake"), + src=os.path.join(self.source_folder, os.pardir)) rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rm(self, "*.pdb", self.package_folder, True) def package_info(self): - # FIXME: FindOpenSceneGraph.cmake is shipped with cmake and is a traditional cmake script # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/cmake/OpenSceneGraphConfig.cmake.in - # It doesn't setup targets and only provides a few variables: - # - OPENSCENEGRAPH_FOUND - # - OPENSCENEGRAPH_VERSION - # - OPENSCENEGRAPH_INCLUDE_DIRS - # - OPENSCENEGRAPH_LIBRARIES - self.cpp_info.set_property("cmake_file_name", "OpenSceneGraph") - self.cpp_info.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOSG.cmake + self.cpp_info.set_property("cmake_module_file_name", "OSG") + # Disable the automatically created targets, use the "openscenegraph" component instead + self.cpp_info.set_property("pkg_config_name", None) + self.cpp_info.set_property("cmake_target_name", None) + + # Export CMake variables set by the project + self.cpp_info.builddirs.append(os.path.join("lib", "cmake")) + cmake_vars_module = os.path.join("lib", "cmake", "conan-official-osg-variables.cmake") + self.cpp_info.set_property("cmake_build_modules", [cmake_vars_module]) + + # The main component that depends on all non-plugin components + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openscenegraph.pc.in + openscenegraph = self.cpp_info.components["openscenegraph"] + openscenegraph.set_property("pkg_config_name", "openscenegraph") + # Unofficial CMake target + openscenegraph.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") + openscenegraph.requires = [ + "osg", + "osgDB", + "osgFX", + "osgGA", + "osgParticle", + "osgSim", + "osgText", + "osgUtil", + "osgTerrain", + "osgManipulator", + "osgViewer", + "osgWidget", + "osgShadow", + "osgAnimation", + "osgVolume", + ] # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.names["cmake_find_package"] = "OpenSceneGraph" - self.cpp_info.names["cmake_find_package_multi"] = "OpenSceneGraph" + self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" + self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package"] = "OpenSceneGraph" + openscenegraph.names["cmake_find_package_multi"] = "OpenSceneGraph" + self.cpp_info.build_modules["cmake_find_package"].append(cmake_vars_module) + self.cpp_info.build_modules["cmake_find_package_multi"].append(cmake_vars_module) if self.settings.build_type == "Debug": postfix = "d" @@ -332,11 +366,14 @@ def setup_library(lib): # Core libraries # requires obtained from osg's source code - # TODO: FindOpenThreads.cmake is shipped with CMake, so we should generate separate - # files for it with cmake_find_package and cmake_find_package_multi + # The project installs FindOpenThreads.cmake as a separate module. + # Conan cannot recreate that, but let's export it as a component instead. + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/CMakeModules/FindOpenThreads.cmake + # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openthreads.pc.in library = self.cpp_info.components["OpenThreads"] library.libs = ["OpenThreads" + postfix] library.set_property("pkg_config_name", "openthreads") + library.set_property("cmake_target_name", "OpenThreads::OpenThreads") if self.settings.os in ["Linux", "FreeBSD"]: library.system_libs = ["pthread"] From 8a8d5ffc24bcaa85ab22f22d5ac29a5dc82dc271 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 11:03:59 +0200 Subject: [PATCH 13/45] openscenegraph: fix v1 incompatibility --- recipes/openscenegraph/all/conanfile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 219a12aa1ec10..64823e3ce5c98 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -321,8 +321,8 @@ def package_info(self): ] # TODO: to remove in conan v2 once cmake_find_package_* generators removed - self.cpp_info.filenames["cmake_find_package"] = "OpenSceneGraph" - self.cpp_info.filenames["cmake_find_package_multi"] = "OpenSceneGraph" + self.cpp_info.names["cmake_find_package"] = "OpenSceneGraph" + self.cpp_info.names["cmake_find_package_multi"] = "OpenSceneGraph" openscenegraph.names["cmake_find_package"] = "OpenSceneGraph" openscenegraph.names["cmake_find_package_multi"] = "OpenSceneGraph" self.cpp_info.build_modules["cmake_find_package"].append(cmake_vars_module) @@ -561,18 +561,18 @@ def setup_library(lib): setup_plugin("imageio").frameworks = ["Accelerate"] if ( - (self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") or - (self.settings.os == "iOS" and self.settings.os.version and Version(self.settings.os.version) >= "6.0") + (self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") or + (self.settings.os == "iOS" and self.settings.os.version and Version(self.settings.os.version) >= "6.0") ): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] if ( - is_apple_os(self) - and self.settings.os.version - and Version(self.settings.os.version) <= "10.6" - and self.settings.arch == "x86" + is_apple_os(self) + and self.settings.os.version + and Version(self.settings.os.version) <= "10.6" + and self.settings.arch == "x86" ): setup_plugin("qt").frameworks = ["QuickTime"] From f756c375fe657541bb0f2bcb975674710798cf97 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 4 Jan 2024 13:05:50 +0200 Subject: [PATCH 14/45] openscenegraph: drop test_v1_package --- .../all/test_v1_package/CMakeLists.txt | 8 ------ .../all/test_v1_package/conanfile.py | 26 ------------------- 2 files changed, 34 deletions(-) delete mode 100644 recipes/openscenegraph/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/openscenegraph/all/test_v1_package/conanfile.py diff --git a/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt b/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 91630d79f4abb..0000000000000 --- a/recipes/openscenegraph/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.15) -project(test_package) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/openscenegraph/all/test_v1_package/conanfile.py b/recipes/openscenegraph/all/test_v1_package/conanfile.py deleted file mode 100644 index 0297948c57332..0000000000000 --- a/recipes/openscenegraph/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,26 +0,0 @@ -from conan.tools.apple import is_apple_os -from conans import CMake, ConanFile, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - for key, value in self.options["openscenegraph"].items(): - if key.startswith("with_"): - cmake.definitions["OSG_HAS_" + key.upper()] = 1 if value else 0 - if is_apple_os(self): - cmake.definitions["OSG_HAS_WITH_GIF"] = 0 - cmake.definitions["OSG_HAS_WITH_JPEG"] = 0 - cmake.definitions["OSG_HAS_WITH_PNG"] = 0 - - 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) From ceca0e6644f8393e99fd9b1c5ef8a4abaf59ab37 Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 18 Jan 2024 07:27:18 +0100 Subject: [PATCH 15/45] wip --- recipes/openscenegraph/all/CMakeLists.txt | 2 +- recipes/openscenegraph/all/conanfile.py | 1 + recipes/openscenegraph/all/test_package/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index 77f53647eabb7..cda16a172286e 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -17,7 +17,7 @@ macro(custom_find_package name variable) set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) unset(name_upper) else() - set(CMAKE_DISABLE_FIND_PACKAGE_${name} TRUE) + #set(CMAKE_DISABLE_FIND_PACKAGE_${name} TRUE) set(${name}_FOUND FALSE) set(${name_upper}_FOUND FALSE) endif() diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 64823e3ce5c98..936e0e7434a14 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -299,6 +299,7 @@ def package_info(self): # The main component that depends on all non-plugin components # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openscenegraph.pc.in openscenegraph = self.cpp_info.components["openscenegraph"] + openscenegraph.libdirs.append(os.path.join("lib", f"osgPlugins-{self.version}")) openscenegraph.set_property("pkg_config_name", "openscenegraph") # Unofficial CMake target openscenegraph.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index 679e470165253..8f9bae7d43e4c 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -11,4 +11,4 @@ foreach(cache_variable ${cache_variables}) endforeach() add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph) +target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph openscenegraph::osgdb_gz openscenegraph::osgdb_bmp openscenegraph::osgdb_freetype openscenegraph::osgdb_imageio) From 2f630cfe177ebcc0e283adefde13cc26f66bf22f Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 22 Jan 2024 17:02:09 +0100 Subject: [PATCH 16/45] wip --- .../all/test_package/CMakeLists.txt | 60 ++++++++++++++++--- .../all/test_package/conanfile.py | 5 ++ .../all/test_package/test_package.cpp | 10 ---- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/recipes/openscenegraph/all/test_package/CMakeLists.txt b/recipes/openscenegraph/all/test_package/CMakeLists.txt index 8f9bae7d43e4c..fcd48ccf6e39d 100644 --- a/recipes/openscenegraph/all/test_package/CMakeLists.txt +++ b/recipes/openscenegraph/all/test_package/CMakeLists.txt @@ -2,13 +2,57 @@ cmake_minimum_required(VERSION 3.15) project(test_package LANGUAGES CXX) find_package(OpenSceneGraph REQUIRED CONFIG) +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph) -get_property(cache_variables DIRECTORY PROPERTY CACHE_VARIABLES) -foreach(cache_variable ${cache_variables}) - if("${cache_variable}" MATCHES "^OSG_HAS_(WITH_.+)$") - add_compile_definitions("${CMAKE_MATCH_1}=${${cache_variable}}") - endif() +get_directory_property(compile_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) +foreach(compile_definition ${compile_definitions}) + if("${compile_definition}" MATCHES "(WITH_.+)=(1)$") + string(REPLACE "=" ";" definition_list ${compile_definition}) + list(GET definition_list 0 definition_key) + list(GET definition_list 1 definition_value) + message("Defined: ${definition_key}=${definition_value}") + if("${definition_key}" STREQUAL "WITH_BMP") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_bmp) + endif() + if("${definition_key}" STREQUAL "WITH_JPEG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jpeg) + endif() + if("${definition_key}" STREQUAL "WITH_JASPER") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_jp2) + endif() + if("${definition_key}" STREQUAL "WITH_OPENEXR") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_exr) + endif() + if("${definition_key}" STREQUAL "WITH_GIF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gif) + endif() + if("${definition_key}" STREQUAL "WITH_PNG") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_png) + endif() + if("${definition_key}" STREQUAL "WITH_TIFF") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_tiff) + endif() + if("${definition_key}" STREQUAL "WITH_GDAL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gdal) + endif() + if("${definition_key}" STREQUAL "WITH_GTA") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gta) + endif() + if("${definition_key}" STREQUAL "WITH_DCMTK") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_dicom) + endif() + if("${definition_key}" STREQUAL "WITH_CURL") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_curl) + endif() + if("${definition_key}" STREQUAL "WITH_ZLIB") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_gz) + endif() + if("${definition_key}" STREQUAL "WITH_FREETYPE") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_freetype) + endif() + if("${definition_key}" STREQUAL "WITH_IMAGEIO") + target_link_libraries(${PROJECT_NAME} openscenegraph::osgdb_imageio) + endif() + endif() endforeach() - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} OpenSceneGraph::OpenSceneGraph openscenegraph::osgdb_gz openscenegraph::osgdb_bmp openscenegraph::osgdb_freetype openscenegraph::osgdb_imageio) diff --git a/recipes/openscenegraph/all/test_package/conanfile.py b/recipes/openscenegraph/all/test_package/conanfile.py index 6ce3e56d71a81..b27efd09cb3f1 100644 --- a/recipes/openscenegraph/all/test_package/conanfile.py +++ b/recipes/openscenegraph/all/test_package/conanfile.py @@ -21,10 +21,15 @@ def generate(self): for key, value in self.dependencies["openscenegraph"].options.items(): if key.startswith("with_"): tc.preprocessor_definitions[key.upper()] = 1 if str(value) != "False" else 0 + #OSG always builds the bmp plugin + tc.preprocessor_definitions["WITH_BMP"] = 1 if is_apple_os(self): tc.preprocessor_definitions["WITH_GIF"] = 0 tc.preprocessor_definitions["WITH_JPEG"] = 0 tc.preprocessor_definitions["WITH_PNG"] = 0 + # OSG builds the imageio plugin on apple platforms + tc.preprocessor_definitions["WITH_IMAGEIO"] = 1 + tc.generate() def build(self): diff --git a/recipes/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index d165af7b34733..e525d4e3e1386 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -4,16 +4,6 @@ #include #include -// OSG always builds the bmp plugin -#define WITH_BMP 1 - -// OSG builds the imageio plugin on apple platforms -#ifdef __APPLE__ -# define WITH_IMAGEIO 1 -#else -# define WITH_IMAGEIO 0 -#endif - #ifdef OSG_LIBRARY_STATIC # if WITH_BMP == 1 USE_OSGPLUGIN ( bmp ) From ecfb524ab443edc064de4d9e5c405805e2e206e5 Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 22 Jan 2024 17:25:45 +0100 Subject: [PATCH 17/45] wip --- recipes/openscenegraph/all/CMakeLists.txt | 1 - recipes/openscenegraph/all/conanfile.py | 1 - 2 files changed, 2 deletions(-) diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index cda16a172286e..5acc346654c57 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -17,7 +17,6 @@ macro(custom_find_package name variable) set(${name_upper}_DEFINITIONS ${${name}_DEFINITIONS}) unset(name_upper) else() - #set(CMAKE_DISABLE_FIND_PACKAGE_${name} TRUE) set(${name}_FOUND FALSE) set(${name_upper}_FOUND FALSE) endif() diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 936e0e7434a14..64823e3ce5c98 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -299,7 +299,6 @@ def package_info(self): # The main component that depends on all non-plugin components # https://github.com/openscenegraph/OpenSceneGraph/blob/master/packaging/pkgconfig/openscenegraph.pc.in openscenegraph = self.cpp_info.components["openscenegraph"] - openscenegraph.libdirs.append(os.path.join("lib", f"osgPlugins-{self.version}")) openscenegraph.set_property("pkg_config_name", "openscenegraph") # Unofficial CMake target openscenegraph.set_property("cmake_target_name", "OpenSceneGraph::OpenSceneGraph") From dc567271dec54c389e236e8e84ac2ea3b7359331 Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 22 Jan 2024 18:07:12 +0100 Subject: [PATCH 18/45] fix test --- recipes/openscenegraph/all/test_package/test_package.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index e525d4e3e1386..c833eb8e3caee 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -4,6 +4,10 @@ #include #include +#ifndef WITH_IMAGEIO +#define WITH_IMAGEIO 0 +#endif + #ifdef OSG_LIBRARY_STATIC # if WITH_BMP == 1 USE_OSGPLUGIN ( bmp ) From f862d9d68c918ae9557931fe5476162057138f09 Mon Sep 17 00:00:00 2001 From: czoido Date: Tue, 23 Jan 2024 15:21:33 +0100 Subject: [PATCH 19/45] do not convert LIBRARY to LIBRARIES --- recipes/openscenegraph/all/conanfile.py | 16 +++++++++------- .../0005-use-JPEG-target-for-plugin.patch | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 64823e3ce5c98..f6171f5aa9701 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -48,6 +48,7 @@ class OpenSceneGraphConanFile(ConanFile): "with_png": [True, False], "with_tiff": [True, False], "with_zlib": [True, False], + "with_avfoundation": [True, False], "opengl_profile": ["gl1", "gl2", "gl3", "glCore", "gles1", "gles2", "gles3", "gles2+gles3"], } default_options = { @@ -77,6 +78,7 @@ class OpenSceneGraphConanFile(ConanFile): "with_tiff": True, "with_zlib": True, "opengl_profile": "gl2", + "with_avfoundation": True, } def export_sources(self): @@ -100,6 +102,8 @@ def config_options(self): # imageio supports tiff files so the tiff plugin isn't needed on Apple platforms self.options.with_tiff = False + else: + del self.options.with_avfoundation def configure(self): if self.options.shared: @@ -223,6 +227,9 @@ def generate(self): tc.variables["OSG_WITH_PNG"] = self.options.get_safe("with_png", False) tc.variables["OSG_WITH_TIFF"] = self.options.with_tiff + if (self.options.get_safe("with_avfoundation")): + tc.variables["OSG_WITH_AV_FOUNDATION"] = True + if self.settings.os == "Windows": # osg has optional quicktime support on Windows tc.variables["CMAKE_DISABLE_FIND_PACKAGE_QuickTime"] = True @@ -245,8 +252,6 @@ def _patch_sources(self): os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) for path in self.source_path.joinpath("src", "osgPlugins").rglob("CMakeLists.txt"): content = path.read_text() - # Correct usage of *_LIBRARY variables to *_LIBRARIES - content = content.replace("_LIBRARY", "_LIBRARIES") # Allow explicit control of plugins via OSG_WITH_* variables # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) @@ -258,7 +263,7 @@ def _patch_sources(self): r'FILE(TO_CMAKE_PATH "\${CMAKE_\1_OUTPUT_DIRECTORY}/\${RELATIVE_OUTDIR}" TMPVAR)', content) path.write_text(content) - apply_conandata_patches(self) + #apply_conandata_patches(self) # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), @@ -560,10 +565,7 @@ def setup_library(lib): if is_apple_os(self): setup_plugin("imageio").frameworks = ["Accelerate"] - if ( - (self.settings.os == "Macos" and self.settings.os.version and Version(self.settings.os.version) >= "10.8") or - (self.settings.os == "iOS" and self.settings.os.version and Version(self.settings.os.version) >= "6.0") - ): + if (self.options.get_safe("with_avfoundation")): plugin = setup_plugin("avfoundation") plugin.requires.append("osgViewer") plugin.frameworks = ["AVFoundation", "Cocoa", "CoreVideo", "CoreMedia", "QuartzCore"] diff --git a/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch b/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch index fbf4f14222298..7ed60d2a79640 100644 --- a/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch +++ b/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch @@ -16,7 +16,7 @@ index 2d290a29d..93fc4756f 100644 ReaderWriterJPEG.cpp ) --SET(TARGET_LIBRARIES_VARS JPEG_LIBRARIES ) +-SET(TARGET_LIBRARIES_VARS JPEG_LIBRARY ) +SET(TARGET_EXTERNAL_LIBRARIES JPEG::JPEG ) #### end var setup ### SETUP_PLUGIN(jpeg) From d3cbc7f8cdc059a1fde584c67a18a25e33ebe002 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 24 Jan 2024 11:26:11 +0200 Subject: [PATCH 20/45] openscenegraph: re-enable patches Should fix the missing JPEG plugin issue. --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index f6171f5aa9701..2277006c79c3f 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -263,7 +263,7 @@ def _patch_sources(self): r'FILE(TO_CMAKE_PATH "\${CMAKE_\1_OUTPUT_DIRECTORY}/\${RELATIVE_OUTDIR}" TMPVAR)', content) path.write_text(content) - #apply_conandata_patches(self) + apply_conandata_patches(self) # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), From 7032ab36c47afe9c50222a1e84d2c0b3141960d2 Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 25 Jan 2024 10:17:24 +0100 Subject: [PATCH 21/45] add patches, move patch --- recipes/openscenegraph/all/conandata.yml | 3 + recipes/openscenegraph/all/conanfile.py | 7 - .../0001-fix-to_cmake_path-usage.patch | 31 +++ .../0011-remove-deprecated-register.patch | 187 ++++++++++++++++++ 4 files changed, 221 insertions(+), 7 deletions(-) create mode 100644 recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch create mode 100644 recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 57b5dc0002083..8ccaab1c75aa3 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -22,3 +22,6 @@ patches: base_path: source_subfolder patch_type: portability patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 + - patch_file: patches/0011-remove-deprecated-register.patch + patch_type: portability + patch_source: [https://github.com/openscenegraph/OpenSceneGraph/pull/1296, https://github.com/openscenegraph/OpenSceneGraph/pull/951] diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 2277006c79c3f..958b99b56df9c 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -256,13 +256,6 @@ def _patch_sources(self): # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) path.write_text(content) - # Fix file(to_cmake_path ...) usage - path = self.source_path.joinpath("CMakeModules", "OsgMacroUtils.cmake") - content = path.read_text() - content = re.sub(r'FILE\(TO_CMAKE_PATH TMPVAR "CMAKE_(\w+)_OUTPUT_DIRECTORY/\$\{RELATIVE_OUTDIR}"\)', - r'FILE(TO_CMAKE_PATH "\${CMAKE_\1_OUTPUT_DIRECTORY}/\${RELATIVE_OUTDIR}" TMPVAR)', - content) - path.write_text(content) apply_conandata_patches(self) # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. diff --git a/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch b/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch new file mode 100644 index 0000000000000..a9cda7609830e --- /dev/null +++ b/recipes/openscenegraph/all/patches/0001-fix-to_cmake_path-usage.patch @@ -0,0 +1,31 @@ +From bfdb151022c98b065a839a4fbf2995ef9340f6ae Mon Sep 17 00:00:00 2001 +From: "R. Andrew Ohana" +Date: Mon, 21 Sep 2020 10:37:10 -0700 +Subject: [PATCH 1/5] fix to_cmake_path usage + +--- + CMakeModules/OsgMacroUtils.cmake | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake +index dcc1fe37d..c0c2da4e1 100644 +--- a/CMakeModules/OsgMacroUtils.cmake ++++ b/CMakeModules/OsgMacroUtils.cmake +@@ -174,11 +174,11 @@ MACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR) + # Using the output directory properties + + # Global properties (All generators but VS & Xcode) +- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_ARCHIVE_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") ++ FILE(TO_CMAKE_PATH "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) + SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${TMPVAR}") +- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_RUNTIME_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") ++ FILE(TO_CMAKE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) + SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TMPVAR}") +- FILE(TO_CMAKE_PATH TMPVAR "CMAKE_LIBRARY_OUTPUT_DIRECTORY/${RELATIVE_OUTDIR}") ++ FILE(TO_CMAKE_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${RELATIVE_OUTDIR}" TMPVAR) + SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TMPVAR}") + + # Per-configuration property (VS, Xcode) +-- +2.21.0.windows.1 + diff --git a/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch new file mode 100644 index 0000000000000..9a1ea80d16a65 --- /dev/null +++ b/recipes/openscenegraph/all/patches/0011-remove-deprecated-register.patch @@ -0,0 +1,187 @@ +From b9f32bf6df5af101624bb065175097d8d96067c2 Mon Sep 17 00:00:00 2001 +From: czoido +Date: Thu, 25 Jan 2024 09:32:10 +0100 +Subject: [PATCH] remove deprecated register + +--- + src/osgPlugins/cfg/ConfigLexer.cpp | 40 ++++++++++++++--------------- + src/osgPlugins/cfg/ConfigParser.cpp | 16 ++++++------ + 2 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/src/osgPlugins/cfg/ConfigLexer.cpp b/src/osgPlugins/cfg/ConfigLexer.cpp +index 4e169efe4..cba6d6f9e 100644 +--- a/src/osgPlugins/cfg/ConfigLexer.cpp ++++ b/src/osgPlugins/cfg/ConfigLexer.cpp +@@ -832,9 +832,9 @@ YY_MALLOC_DECL + + YY_DECL + { +- register yy_state_type yy_current_state; +- register char *yy_cp, *yy_bp; +- register int yy_act; ++ yy_state_type yy_current_state; ++ char *yy_cp, *yy_bp; ++ int yy_act; + + #line 35 ".././ConfigLexer.l" + +@@ -881,7 +881,7 @@ YY_DECL + yy_match: + do + { +- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; ++ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1598,9 +1598,9 @@ void yyFlexLexer::LexerOutput( const char* buf, int size ) + + int yyFlexLexer::yy_get_next_buffer() + { +- register char *dest = yy_current_buffer->yy_ch_buf; +- register char *source = yytext_ptr; +- register int number_to_move, i; ++ char *dest = yy_current_buffer->yy_ch_buf; ++ char *source = yytext_ptr; ++ int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) +@@ -1730,14 +1730,14 @@ int yyFlexLexer::yy_get_next_buffer() + + yy_state_type yyFlexLexer::yy_get_previous_state() + { +- register yy_state_type yy_current_state; +- register char *yy_cp; ++ yy_state_type yy_current_state; ++ char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { +- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); ++ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1764,10 +1764,10 @@ yy_state_type yyFlexLexer::yy_get_previous_state() + + yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + { +- register int yy_is_jam; +- register char *yy_cp = yy_c_buf_p; ++ int yy_is_jam; ++ char *yy_cp = yy_c_buf_p; + +- register YY_CHAR yy_c = 1; ++ YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; +@@ -1786,9 +1786,9 @@ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) + } + + +-void yyFlexLexer::yyunput( int c, register char* yy_bp ) ++void yyFlexLexer::yyunput( int c, char* yy_bp ) + { +- register char *yy_cp = yy_c_buf_p; ++ char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; +@@ -1796,10 +1796,10 @@ void yyFlexLexer::yyunput( int c, register char* yy_bp ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ +- register int number_to_move = yy_n_chars + 2; +- register char *dest = &yy_current_buffer->yy_ch_buf[ ++ int number_to_move = yy_n_chars + 2; ++ char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; +- register char *source = ++ char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) +@@ -2119,7 +2119,7 @@ yyconst char *s2; + int n; + #endif + { +- register int i; ++ int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +@@ -2133,7 +2133,7 @@ static int yy_flex_strlen( s ) + yyconst char *s; + #endif + { +- register int n; ++ int n; + for ( n = 0; s[n]; ++n ) + ; + +diff --git a/src/osgPlugins/cfg/ConfigParser.cpp b/src/osgPlugins/cfg/ConfigParser.cpp +index 263c82896..62d30c3f5 100644 +--- a/src/osgPlugins/cfg/ConfigParser.cpp ++++ b/src/osgPlugins/cfg/ConfigParser.cpp +@@ -351,7 +351,7 @@ union yyalloc + # define YYCOPY(To, From, Count) \ + do \ + { \ +- register YYSIZE_T yyi; \ ++ YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ +@@ -1025,7 +1025,7 @@ yystrlen (yystr) + const char *yystr; + # endif + { +- register const char *yys = yystr; ++ const char *yys = yystr; + + while (*yys++ != '\0') + continue; +@@ -1050,8 +1050,8 @@ yystpcpy (yydest, yysrc) + const char *yysrc; + # endif + { +- register char *yyd = yydest; +- register const char *yys = yysrc; ++ char *yyd = yydest; ++ const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; +@@ -1175,8 +1175,8 @@ yyparse () + #endif + { + +- register int yystate; +- register int yyn; ++ int yystate; ++ int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; +@@ -1194,12 +1194,12 @@ yyparse () + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; +- register short *yyssp; ++ short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; +- register YYSTYPE *yyvsp; ++ YYSTYPE *yyvsp; + + + +-- +2.39.3 (Apple Git-145) + From fd99ec87fe33a78a132dcc33e5592547973d298b Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 25 Jan 2024 10:19:06 +0100 Subject: [PATCH 22/45] minor changes --- recipes/openscenegraph/all/conandata.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index 8ccaab1c75aa3..b89394b674b06 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -24,4 +24,6 @@ patches: patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0011-remove-deprecated-register.patch patch_type: portability - patch_source: [https://github.com/openscenegraph/OpenSceneGraph/pull/1296, https://github.com/openscenegraph/OpenSceneGraph/pull/951] + patch_source: + - https://github.com/openscenegraph/OpenSceneGraph/pull/1296 + - https://github.com/openscenegraph/OpenSceneGraph/pull/951 From 467ff9df7cf036fc6b01df89571e6558b08650f3 Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 25 Jan 2024 10:21:27 +0100 Subject: [PATCH 23/45] fix linter --- recipes/openscenegraph/all/conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index b89394b674b06..a98918d41c4d1 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -24,6 +24,6 @@ patches: patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0011-remove-deprecated-register.patch patch_type: portability - patch_source: + patch_source: - https://github.com/openscenegraph/OpenSceneGraph/pull/1296 - https://github.com/openscenegraph/OpenSceneGraph/pull/951 From 8ba7abf705f0b90f33d13465a0f56692e20e5424 Mon Sep 17 00:00:00 2001 From: czoido Date: Fri, 26 Jan 2024 10:24:59 +0100 Subject: [PATCH 24/45] fix freetype plugin --- recipes/openscenegraph/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 958b99b56df9c..3a6c80ade1c55 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -261,6 +261,8 @@ def _patch_sources(self): # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. replace_in_file(self, os.path.join(self.source_folder, "src", "osgText", "CMakeLists.txt"), "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), + "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") def build(self): self._patch_sources() From eb12eb31a7d3bc99c6f1ecf0dcebe20ca283611a Mon Sep 17 00:00:00 2001 From: czoido Date: Mon, 29 Jan 2024 12:41:28 +0100 Subject: [PATCH 25/45] wip --- recipes/openscenegraph/all/conanfile.py | 2 ++ .../all/patches/0005-use-JPEG-target-for-plugin.patch | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 3a6c80ade1c55..47988e90c632e 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -252,6 +252,8 @@ def _patch_sources(self): os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) for path in self.source_path.joinpath("src", "osgPlugins").rglob("CMakeLists.txt"): content = path.read_text() + # Correct usage of *_LIBRARY variables to *_LIBRARIES + content = content.replace("_LIBRARY", "_LIBRARIES") # Allow explicit control of plugins via OSG_WITH_* variables # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) diff --git a/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch b/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch index 7ed60d2a79640..fbf4f14222298 100644 --- a/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch +++ b/recipes/openscenegraph/all/patches/0005-use-JPEG-target-for-plugin.patch @@ -16,7 +16,7 @@ index 2d290a29d..93fc4756f 100644 ReaderWriterJPEG.cpp ) --SET(TARGET_LIBRARIES_VARS JPEG_LIBRARY ) +-SET(TARGET_LIBRARIES_VARS JPEG_LIBRARIES ) +SET(TARGET_EXTERNAL_LIBRARIES JPEG::JPEG ) #### end var setup ### SETUP_PLUGIN(jpeg) From 82aa65cc2a679fb5b8a62197ec0fa339453f7a4e Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 1 Feb 2024 09:42:15 +0100 Subject: [PATCH 26/45] wip --- recipes/openscenegraph/all/conanfile.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 47988e90c632e..5a21dc639dbd9 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -258,6 +258,14 @@ def _patch_sources(self): # e.g. replace IF(FFMPEG_FOUND) with IF(OSG_WITH_FFMPEG) content = re.sub(r"\b([A-Z]+)_FOUND\b", r"OSG_WITH_\1", content) path.write_text(content) + for path in self.source_path.joinpath(self.source_folder, "CMakeModules").rglob("*.cmake"): + content = path.read_text(encoding='utf-8', errors='ignore') + lib_match = re.search(r'FIND_LIBRARY\(([^ ]+)_LIBRARY', content) + if lib_match: + library_name = lib_match.group(1) + new_content = re.sub(rf'\b{library_name}_LIBRARY\b', rf'{library_name}_LIBRARIES', content) + path.write_text(new_content) + apply_conandata_patches(self) # Not sure why, but CMake fails to find the EXPAT::EXPAT target created by Conan when Fontconfig is found as a module. From 105394545fb1b977aae334c44c081f011fa0c439 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Mon, 22 Apr 2024 16:23:51 +0200 Subject: [PATCH 27/45] fix rebase issue --- recipes/openscenegraph/all/conandata.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index a98918d41c4d1..afdb6e9747b8d 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -4,6 +4,8 @@ sources: sha256: "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" patches: 3.6.5: + - patch_file: patches/0001-fix-to_cmake_path-usage.patch + - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch base_path: source_subfolder - patch_file: patches/0007-fix-msvc-with-std-c++17.patch From 04e8952e4e345d26b0168976de937b2e21265ff9 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Mon, 22 Apr 2024 16:28:24 +0200 Subject: [PATCH 28/45] fix rebase issue --- recipes/openscenegraph/all/conandata.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index afdb6e9747b8d..c8ad60d55bef5 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -7,21 +7,16 @@ patches: - patch_file: patches/0001-fix-to_cmake_path-usage.patch - patch_file: patches/0005-use-JPEG-target-for-plugin.patch - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch - base_path: source_subfolder - patch_file: patches/0007-fix-msvc-with-std-c++17.patch - base_path: source_subfolder patch_type: bugfix patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1055 - patch_file: patches/0008-replace-mem-fun-ref.patch - base_path: source_subfolder patch_type: bugfix patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/8a0114a46a4bad9041297950fe3bfbb2aea6e1da - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch - base_path: source_subfolder patch_type: portability patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch - base_path: source_subfolder patch_type: portability patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0011-remove-deprecated-register.patch From 56cbcd582bdeac9c150e44d3187e9cf258f6aae3 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Mon, 22 Apr 2024 19:52:06 +0200 Subject: [PATCH 29/45] Don't replace OSG_LIBRARY_STATIC in plugins root folder --- recipes/openscenegraph/all/conanfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 5a21dc639dbd9..c5e652bb9e088 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -1,5 +1,6 @@ import os import re +from pathlib import Path from conan import ConanFile from conan.errors import ConanInvalidConfiguration @@ -250,7 +251,11 @@ def _patch_sources(self): for package in ["Fontconfig", "Freetype", "GDAL", "GIFLIB", "GTA", "Jasper", "OpenEXR"]: # Prefer conan's find package scripts over osg's os.unlink(os.path.join(self.source_folder, "CMakeModules", f"Find{package}.cmake")) - for path in self.source_path.joinpath("src", "osgPlugins").rglob("CMakeLists.txt"): + plugins_root = Path(self.source_path.joinpath("src", "osgPlugins")) + for path in plugins_root.rglob("CMakeLists.txt"): + if path.parent == plugins_root: + # Don't replace in the root dir + continue content = path.read_text() # Correct usage of *_LIBRARY variables to *_LIBRARIES content = content.replace("_LIBRARY", "_LIBRARIES") From 37f623eafcf3fca509102c6e794fb72a2b3633b0 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 09:54:56 +0200 Subject: [PATCH 30/45] test, try to find png/gif/jpeg also on macos --- recipes/openscenegraph/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index c5e652bb9e088..d620c4c2b674d 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -278,6 +278,9 @@ def _patch_sources(self): "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") + # Find png, gif, jpeg also on macos + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "FIND_PACKAGE(AVFoundation)", "FIND_PACKAGE(AVFoundation)\nFIND_PACKAGE(GIFLIB)\nFIND_PACKAGE(JPEG)\nFIND_PACKAGE(PNG)") def build(self): self._patch_sources() From ee81883f5aade75d9ccd5aa6731340d484b494c6 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 10:42:20 +0200 Subject: [PATCH 31/45] Revert "test, try to find png/gif/jpeg also on macos" This reverts commit 58d4707cb268ed00ff6e449098bcf3ddfee5a961. --- recipes/openscenegraph/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index d620c4c2b674d..c5e652bb9e088 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -278,9 +278,6 @@ def _patch_sources(self): "find_package(Fontconfig MODULE)", "find_package(Fontconfig CONFIG REQUIRED)") replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") - # Find png, gif, jpeg also on macos - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "FIND_PACKAGE(AVFoundation)", "FIND_PACKAGE(AVFoundation)\nFIND_PACKAGE(GIFLIB)\nFIND_PACKAGE(JPEG)\nFIND_PACKAGE(PNG)") def build(self): self._patch_sources() From 455a9312fdd4d4ad9678f90a90954aa9af54cc63 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 11:14:43 +0200 Subject: [PATCH 32/45] Add extra guard to not include png plug-in on macos --- recipes/openscenegraph/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index c5e652bb9e088..5c85f75e73e7e 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -279,6 +279,11 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "freetype", "CMakeLists.txt"), "SET(TARGET_EXTERNAL_LIBRARIES ${FREETYPE_LIBRARIES} )", "SET(TARGET_EXTERNAL_LIBRARIES Freetype::Freetype)") + # osg uses imageio on Apple platforms. PNG_FOUND will be set by `FIND_PACKAGE(Freetype)` + # in the OSG cmake code and without this patch the png plugin will be included even though it shouldn't. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "PNG_FOUND", "PNG_FOUND AND OSG_WITH_PNG") + def build(self): self._patch_sources() cmake = CMake(self) From 20d3a27970b2ef07167e81cab414c01a465dab24 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 16:19:03 +0200 Subject: [PATCH 33/45] Disable a check in the test For some reason the test on Mac fails with: Looking for curl support: found (expected not found) for shared=True builds... --- recipes/openscenegraph/all/test_package/test_package.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index c833eb8e3caee..77547876bac23 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -95,9 +95,12 @@ int main ( int argc, char** argv ) res |= check_plugin ( "gdal", WITH_GDAL ); res |= check_plugin ( "gta", WITH_GTA ); res |= check_plugin ( "dcm", WITH_DCMTK ); - res |= check_plugin ( "curl", WITH_CURL ); // Replace with a better test that checks for supported protocols res |= check_plugin ( "gz", WITH_ZLIB ); res |= check_plugin ( "ttf", WITH_FREETYPE ); +#ifdef OSG_LIBRARY_STATIC + res |= check_plugin ( "curl", WITH_CURL ); // Replace with a better test that checks for supported protocols +#endif + return res; } From 2240c0d38279cb0156658a7664b51c2f4bb18f44 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 16:49:39 +0200 Subject: [PATCH 34/45] Revert "Disable a check in the test" This reverts commit aed59cc7b47b52ee3f4197862554b0b991aa3bf1. --- recipes/openscenegraph/all/test_package/test_package.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/openscenegraph/all/test_package/test_package.cpp b/recipes/openscenegraph/all/test_package/test_package.cpp index 77547876bac23..c833eb8e3caee 100644 --- a/recipes/openscenegraph/all/test_package/test_package.cpp +++ b/recipes/openscenegraph/all/test_package/test_package.cpp @@ -95,12 +95,9 @@ int main ( int argc, char** argv ) res |= check_plugin ( "gdal", WITH_GDAL ); res |= check_plugin ( "gta", WITH_GTA ); res |= check_plugin ( "dcm", WITH_DCMTK ); + res |= check_plugin ( "curl", WITH_CURL ); // Replace with a better test that checks for supported protocols res |= check_plugin ( "gz", WITH_ZLIB ); res |= check_plugin ( "ttf", WITH_FREETYPE ); -#ifdef OSG_LIBRARY_STATIC - res |= check_plugin ( "curl", WITH_CURL ); // Replace with a better test that checks for supported protocols -#endif - return res; } From e3e554906eba4df39025ce5fa3406f256d108d6d Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 23 Apr 2024 16:50:07 +0200 Subject: [PATCH 35/45] Make sure curl plug-in is only enabled if requested --- recipes/openscenegraph/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 5c85f75e73e7e..c0dbc2aab69d8 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -284,6 +284,10 @@ def _patch_sources(self): replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), "PNG_FOUND", "PNG_FOUND AND OSG_WITH_PNG") + # Only add curl plugin if actually requested. + replace_in_file(self, os.path.join(self.source_folder, "src", "osgPlugins", "CMakeLists.txt"), + "CURL_FOUND", "CURL_FOUND AND OSG_WITH_CURL") + def build(self): self._patch_sources() cmake = CMake(self) From ca4d926f0fcacc484257e30b1561186633a603b9 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Wed, 24 Apr 2024 11:32:11 +0200 Subject: [PATCH 36/45] Try to fix issues with longpaths... --- recipes/openscenegraph/all/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index 5acc346654c57..45c3d25a4f400 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -1,4 +1,8 @@ cmake_minimum_required(VERSION 3.15) + +# Disable tracker since it causes issues with long paths +set(CMAKE_VS_GLOBALS "TrackFileAccess=false") + project(cmake_wrapper) macro(custom_find_package name variable) From fd80f2136e2b60bf24b6385f8cef0fe6c3bc5a85 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Wed, 24 Apr 2024 13:33:10 +0200 Subject: [PATCH 37/45] Revert "Try to fix issues with longpaths..." This reverts commit b3e2dbaf5a3675b9919e3859fa0501edf81216b0. --- recipes/openscenegraph/all/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipes/openscenegraph/all/CMakeLists.txt b/recipes/openscenegraph/all/CMakeLists.txt index 45c3d25a4f400..5acc346654c57 100644 --- a/recipes/openscenegraph/all/CMakeLists.txt +++ b/recipes/openscenegraph/all/CMakeLists.txt @@ -1,8 +1,4 @@ cmake_minimum_required(VERSION 3.15) - -# Disable tracker since it causes issues with long paths -set(CMAKE_VS_GLOBALS "TrackFileAccess=false") - project(cmake_wrapper) macro(custom_find_package name variable) From dae498d1af6249a2b82ff15643effd72c609a28c Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Wed, 24 Apr 2024 13:34:20 +0200 Subject: [PATCH 38/45] add back short paths to please conan 1 builds --- recipes/openscenegraph/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index c0dbc2aab69d8..032234721bbcf 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -81,6 +81,7 @@ class OpenSceneGraphConanFile(ConanFile): "opengl_profile": "gl2", "with_avfoundation": True, } + short_paths = True def export_sources(self): copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder) From 68128c2cdb8549f57c4000dee7780f4d129bf9cb Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Sat, 27 Apr 2024 09:36:21 +0200 Subject: [PATCH 39/45] fix some warnings --- recipes/openscenegraph/all/conandata.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/recipes/openscenegraph/all/conandata.yml b/recipes/openscenegraph/all/conandata.yml index c8ad60d55bef5..094e9853e6fca 100644 --- a/recipes/openscenegraph/all/conandata.yml +++ b/recipes/openscenegraph/all/conandata.yml @@ -5,22 +5,34 @@ sources: patches: 3.6.5: - patch_file: patches/0001-fix-to_cmake_path-usage.patch + patch_description: Fix cmake paths + patch_type: portability - patch_file: patches/0005-use-JPEG-target-for-plugin.patch + patch_description: This fixes building against a static libjpeg on windows + patch_type: portability - patch_file: patches/0006-Declare-result-as-LONG-for-Mingw-build.patch + patch_description: Win32's ChangeDisplaySettingsEx() API function is documented as returning `LONG`, which evidently is not always the same as `unsigned int` (Mingw64.) This cause a compile error on Mingw with clang10. + patch_type: official + patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/67468cce344dd5e503aaa1063845f34720563f79 - patch_file: patches/0007-fix-msvc-with-std-c++17.patch - patch_type: bugfix + patch_description: Fix to be able to build with c++17 on MSVC + patch_type: official patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1055 - patch_file: patches/0008-replace-mem-fun-ref.patch - patch_type: bugfix + patch_description: Replaced std::mem_fun_ref usage to avoid compatiblity with modern compilers + patch_type: official patch_source: https://github.com/openscenegraph/OpenSceneGraph/commit/8a0114a46a4bad9041297950fe3bfbb2aea6e1da - patch_file: patches/0009-replace-auto-ptr-in-plugins.patch + patch_description: auto_ptr is removed in C++17. patch_type: portability patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0010-replace-ptr-fun-in-obj-plugin.patch + patch_description: ptr_fun is removed in C++17 patch_type: portability patch_source: https://github.com/openscenegraph/OpenSceneGraph/pull/1246 - patch_file: patches/0011-remove-deprecated-register.patch - patch_type: portability + patch_description: The "register" keyword is deprecated as of C++17 + patch_type: bugfix patch_source: - https://github.com/openscenegraph/OpenSceneGraph/pull/1296 - https://github.com/openscenegraph/OpenSceneGraph/pull/951 From a0fd973192923c07a8624cbca2639ac9e0fa47f5 Mon Sep 17 00:00:00 2001 From: Anton Danielsson Date: Tue, 14 May 2024 19:26:31 +0200 Subject: [PATCH 40/45] Update recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch Co-authored-by: Jordan Williams --- .../all/patches/0009-replace-auto-ptr-in-plugins.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch index fcd865d09b2d6..de0f3ee7139ef 100644 --- a/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch +++ b/recipes/openscenegraph/all/patches/0009-replace-auto-ptr-in-plugins.patch @@ -20,7 +20,7 @@ index 69826c456..9bba5532a 100644 #define STREAM_TIMEOUT_IN_SECONDS_TO_CONSIDER_IT_DEAD 10 +#if ((defined(_MSVC_LANG) && _MSVC_LANG > 199711L) || __cplusplus > 199711L) -+ #define smart_ptr std::unique_ptr ++ template using smart_ptr = std::unique_ptr; +#else + #define smart_ptr std::auto_ptr +#endif From b5372fa221b58e44598b9bc0a90cbcf06b32c707 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Mon, 20 May 2024 16:53:54 +0200 Subject: [PATCH 41/45] Update recipes/openscenegraph/all/conanfile.py --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 032234721bbcf..ed4081880f282 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -130,7 +130,7 @@ def requirements(self): if self.options.get_safe("with_asio"): # Should these be private requires? - self.requires("asio/1.28.2") + self.requires("asio/1.28.1") self.requires("boost/1.83.0") if self.options.with_curl: self.requires("libcurl/[>=7.78 <9]") From dce6a39f9e746c57b95b831ca5ea14ebe6ea7bb3 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Mon, 20 May 2024 16:54:01 +0200 Subject: [PATCH 42/45] Update recipes/openscenegraph/all/conanfile.py --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index ed4081880f282..7ef5af4c75717 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -139,7 +139,7 @@ def requirements(self): if self.options.with_freetype: self.requires("freetype/2.13.2") if self.options.with_gdal: - self.requires("gdal/3.8.0") + self.requires("gdal/3.8.3") if self.options.get_safe("with_gif"): self.requires("giflib/5.2.1") if self.options.with_gta: From 0e21fc21cd16e75819395a56b8e6b02fce2caeec Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Mon, 20 May 2024 16:54:08 +0200 Subject: [PATCH 43/45] Update recipes/openscenegraph/all/conanfile.py --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 7ef5af4c75717..4588c228e047a 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -145,7 +145,7 @@ def requirements(self): if self.options.with_gta: self.requires("libgta/1.2.1") if self.options.with_jasper: - self.requires("jasper/4.1.0") + self.requires("jasper/4.2.0") if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": From 3cb4d20ccf31a32231f79e6d9faf3567a4366e1c Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Mon, 20 May 2024 16:54:14 +0200 Subject: [PATCH 44/45] Update recipes/openscenegraph/all/conanfile.py --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 4588c228e047a..1050b6dfbffd2 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -149,7 +149,7 @@ def requirements(self): if self.options.get_safe("with_jpeg") == "libjpeg": self.requires("libjpeg/9e") elif self.options.get_safe("with_jpeg") == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.0") + self.requires("libjpeg-turbo/3.0.2") elif self.options.get_safe("with_jpeg") == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_openexr"): From 27bad527049e85cc56cf76269e358d897fdb60e6 Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Mon, 20 May 2024 16:54:20 +0200 Subject: [PATCH 45/45] Update recipes/openscenegraph/all/conanfile.py --- recipes/openscenegraph/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openscenegraph/all/conanfile.py b/recipes/openscenegraph/all/conanfile.py index 1050b6dfbffd2..8ed902063ca31 100644 --- a/recipes/openscenegraph/all/conanfile.py +++ b/recipes/openscenegraph/all/conanfile.py @@ -153,7 +153,7 @@ def requirements(self): elif self.options.get_safe("with_jpeg") == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.get_safe("with_openexr"): - self.requires("openexr/3.1.9") + self.requires("openexr/3.2.3") if self.options.get_safe("with_png"): self.requires("libpng/1.6.40") if self.options.with_tiff: