🔨 Reduce amount of patches for MyGUI

This commit is contained in:
Edgar 2021-10-23 16:17:11 +02:00
parent 545b386cf6
commit 87febdff3c
No known key found for this signature in database
GPG Key ID: 17D930BB616061A5
6 changed files with 23 additions and 81 deletions

View File

@ -8,10 +8,8 @@ sources:
patches:
"3.4.0":
- patch_file: "patches/3.4.0/CMakeLists.txt.patch"
- patch_file: "patches/3.4.0/AddLibPNG.patch"
"3.4.1":
- patch_file: "patches/3.4.1/CMakeLists.txt.patch"
- patch_file: "patches/3.4.1/AddLibPNG.patch"
requirements:
- "ogre3d/[1.x]@anotherfoxguy/stable"
- "freetype/[2.x]"

View File

@ -8,17 +8,21 @@ class MyGUIConan(ConanFile):
url = "https://github.com/AnotherFoxGuy/conan-MyGUI"
description = "Fast, flexible and simple GUI."
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths"
generators = "cmake_paths", "cmake_find_package"
exports_sources = "patches/**"
options = {"system_ogre": [True, False]}
default_options = {"system_ogre": False}
def requirements(self):
for req in self.conan_data["requirements"]:
self.requires(req)
if not self.options.system_ogre:
for req in self.conan_data["requirements"]:
self.requires(req)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
if not self.options.system_ogre:
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
def build(self):
cmake = CMake(self)
@ -42,4 +46,5 @@ class MyGUIConan(ConanFile):
self.cpp_info.libs = tools.collect_libs(self)
def package_id(self):
self.info.requires["ogre3d"].full_recipe_mode()
if not self.options.system_ogre:
self.info.requires["ogre3d"].full_recipe_mode()

View File

@ -1,27 +0,0 @@
--- MyGUIEngine/CMakeLists.txt
+++ MyGUIEngine/CMakeLists.txt
@@ -41,8 +41,24 @@
endif()
if (MYGUI_USE_FREETYPE)
+ # 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()
target_link_libraries(${PROJECTNAME}
${FREETYPE_LIBRARIES}
+ ${PNG_LIBRARIES}
+ ${BZIP2_LIBRARIES}
+ ${BROTLI_LIBRARIES}
${ZLIB_LIBRARIES}
)
endif()

View File

@ -1,6 +1,6 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,6 +11,8 @@
@@ -11,8 +11,11 @@
project(MYGUI)
@ -8,4 +8,7 @@
+
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${MYGUI_SOURCE_DIR}/CMake"
"${MYGUI_SOURCE_DIR}/CMake/Utils"
"${MYGUI_SOURCE_DIR}/CMake/Packages"

View File

@ -1,39 +0,0 @@
--- MyGUIEngine/CMakeLists.txt
+++ MyGUIEngine/CMakeLists.txt
@@ -1,5 +1,19 @@
set (PROJECTNAME MyGUIEngine)
+# 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()
+
project( ${PROJECTNAME} )
include(${PROJECTNAME}.list)
@@ -42,10 +56,12 @@
target_link_libraries(${PROJECTNAME} msdfgen)
endif ()
- target_link_libraries(${PROJECTNAME} ${FREETYPE_LIBRARIES})
- if (ZLIB_FOUND) # hacky way to check if freetype was built with zlib
- target_link_libraries(${PROJECTNAME} ${ZLIB_LIBRARIES})
- endif()
+ target_link_libraries(${PROJECTNAME}
+ ${PNG_LIBRARIES}
+ ${BZIP2_LIBRARIES}
+ ${BROTLI_LIBRARIES}
+ ${FREETYPE_LIBRARIES})
+
endif()
# platform specific dependencies

View File

@ -1,12 +1,14 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -20,6 +20,8 @@
cmake_policy(SET CMP0083 NEW)
endif()
@@ -22,8 +22,11 @@
project(MYGUI)
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
+
project(MYGUI)
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${MYGUI_SOURCE_DIR}/CMake"
"${MYGUI_SOURCE_DIR}/CMake/Utils"
"${MYGUI_SOURCE_DIR}/CMake/Packages"