From fafacf76f33f9fe1ab980ac9bfe0368c4f070caa Mon Sep 17 00:00:00 2001 From: Edgar Date: Fri, 10 Sep 2021 11:56:09 +0000 Subject: [PATCH] :hammer: Reduce amount of patches for OGRE 1.12 --- ogre/1.12/conandata.yml | 2 +- ogre/1.12/conanfile.py | 10 ++++-- ogre/1.12/patches/1.12.13/AddLibPNG.patch | 32 ------------------- .../1.12/patches/1.12.13/CMakeLists.txt.patch | 10 +++--- .../1.12.13/FixFindOpenGLES2.cmake.patch | 11 +++++++ 5 files changed, 25 insertions(+), 40 deletions(-) delete mode 100644 ogre/1.12/patches/1.12.13/AddLibPNG.patch create mode 100644 ogre/1.12/patches/1.12.13/FixFindOpenGLES2.cmake.patch diff --git a/ogre/1.12/conandata.yml b/ogre/1.12/conandata.yml index df82c8e..dafbef9 100644 --- a/ogre/1.12/conandata.yml +++ b/ogre/1.12/conandata.yml @@ -5,7 +5,7 @@ sources: patches: "1.12.13": - patch_file: "patches/1.12.13/CMakeLists.txt.patch" - - patch_file: "patches/1.12.13/AddLibPNG.patch" + - patch_file: "patches/1.12.13/FixFindOpenGLES2.cmake.patch" - patch_file: "patches/1.12.13/pugixml-fix.patch" - patch_file: "patches/1.12.13/FindPkgMacros.cmake.patch" requirements: diff --git a/ogre/1.12/conanfile.py b/ogre/1.12/conanfile.py index 3710ec1..c8112bc 100644 --- a/ogre/1.12/conanfile.py +++ b/ogre/1.12/conanfile.py @@ -8,6 +8,12 @@ class OGREConan(ConanFile): url = "https://github.com/AnotherFoxGuy/conan-OGRE" description = "scene-oriented, flexible 3D engine written in C++" settings = "os", "compiler", "build_type", "arch" + options = { + "resourcemanager_strict": [0, 1, 2] + } + default_options = { + "resourcemanager_strict": 0 + } generators = "cmake_paths", "cmake_find_package" exports_sources = "patches/**" @@ -34,13 +40,13 @@ class OGREConan(ConanFile): cmake.definitions["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF" cmake.definitions["OGRE_BUILD_COMPONENT_JAVA"] = "OFF" cmake.definitions["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF" - cmake.definitions["OGRE_BUILD_PLUGIN_STBI"] = "OFF" + cmake.definitions["OGRE_BUILD_PLUGIN_STBI"] = "ON" cmake.definitions["OGRE_BUILD_COMPONENT_BITES"] = "ON" cmake.definitions["OGRE_BUILD_SAMPLES"] = "OFF" cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D9"] = "ON" cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON" cmake.definitions["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF" - cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = 0 + cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = self.options.resourcemanager_strict cmake.definitions["OGRE_INSTALL_SAMPLES"] = "OFF" cmake.definitions["OGRE_BUILD_PLUGIN_DOT_SCENE"] = "OFF" if os_info.is_windows: diff --git a/ogre/1.12/patches/1.12.13/AddLibPNG.patch b/ogre/1.12/patches/1.12.13/AddLibPNG.patch deleted file mode 100644 index 0ba7209..0000000 --- a/ogre/1.12/patches/1.12.13/AddLibPNG.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- Components/Overlay/CMakeLists.txt -+++ Components/Overlay/CMakeLists.txt -@@ -11,6 +11,20 @@ - # Overlay optional component - ############################################################ - -+# FreeType from conan has seperate libraries -+find_package(PNG) -+find_package(BZip2) -+ -+find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon brotlicommon-static) -+find_library(BROTLIDEC_LIBRARY NAMES brotlidec brotlidec-static) -+ -+if(NOT ${BROTLIDEC_LIBRARY} STREQUAL "BROTLICOMMON_LIBRARY-NOTFOUND" AND NOT ${BROTLIDEC_LIBRARY} STREQUAL "BROTLIDEC_LIBRARY-NOTFOUND") -+ set(BROTLI_LIBRARIES ${BROTLICOMMON_LIBRARY} ${BROTLIDEC_LIBRARY}) -+ message(STATUS "Brotli libraries found: ${BROTLI_LIBRARIES}") -+else() -+ message(WARNING "Brotli library not found: ${BROTLICOMMON_LIBRARY} ${BROTLIDEC_LIBRARY}") -+endif() -+ - # define header and source files for the library - file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") - list(APPEND HEADER_FILES -@@ -41,7 +55,7 @@ - # setup target - add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES}) - set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION}) --target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE ${FREETYPE_LIBRARIES} ZLIB::ZLIB) -+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE Freetype::Freetype ${PNG_LIBRARIES} ${BZIP2_LIBRARIES} ${BROTLI_LIBRARIES} ZLIB::ZLIB) - target_include_directories(OgreOverlay PUBLIC - "$" - $ diff --git a/ogre/1.12/patches/1.12.13/CMakeLists.txt.patch b/ogre/1.12/patches/1.12.13/CMakeLists.txt.patch index aa3d8e2..b6f1e30 100644 --- a/ogre/1.12/patches/1.12.13/CMakeLists.txt.patch +++ b/ogre/1.12/patches/1.12.13/CMakeLists.txt.patch @@ -9,11 +9,11 @@ if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") set(CMAKE_LINK_LIBRARY_FLAG "") endif() -@@ -74,6 +76,7 @@ +@@ -71,6 +71,7 @@ + + # Include necessary submodules + set(CMAKE_MODULE_PATH ++ "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/CMake" "${PROJECT_SOURCE_DIR}/CMake/Utils" "${PROJECT_SOURCE_DIR}/CMake/Packages" -+ "${CMAKE_BINARY_DIR}" - ) - - include(CMakeDependentOption) diff --git a/ogre/1.12/patches/1.12.13/FixFindOpenGLES2.cmake.patch b/ogre/1.12/patches/1.12.13/FixFindOpenGLES2.cmake.patch new file mode 100644 index 0000000..9986338 --- /dev/null +++ b/ogre/1.12/patches/1.12.13/FixFindOpenGLES2.cmake.patch @@ -0,0 +1,11 @@ +--- CMake/Packages/FindOpenGLES2.cmake ++++ CMake/Packages/FindOpenGLES2.cmake +@@ -23,6 +23,8 @@ + # EGL_INCLUDE_DIR - the EGL include directory + # EGL_LIBRARIES - Link these to use EGL + ++include(FindPkgMacros) ++ + IF(APPLE) + create_search_paths(/Developer/Platforms) + findpkg_framework(OpenGLES2)