diff --git a/mygui/all/conandata.yml b/mygui/all/conandata.yml index cdfc27c..5f3ab27 100644 --- a/mygui/all/conandata.yml +++ b/mygui/all/conandata.yml @@ -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]" diff --git a/mygui/all/conanfile.py b/mygui/all/conanfile.py index 7a0edbe..ec01076 100644 --- a/mygui/all/conanfile.py +++ b/mygui/all/conanfile.py @@ -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() diff --git a/mygui/all/patches/3.4.0/AddLibPNG.patch b/mygui/all/patches/3.4.0/AddLibPNG.patch deleted file mode 100644 index 6016955..0000000 --- a/mygui/all/patches/3.4.0/AddLibPNG.patch +++ /dev/null @@ -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() diff --git a/mygui/all/patches/3.4.0/CMakeLists.txt.patch b/mygui/all/patches/3.4.0/CMakeLists.txt.patch index 5bbb085..927c02b 100644 --- a/mygui/all/patches/3.4.0/CMakeLists.txt.patch +++ b/mygui/all/patches/3.4.0/CMakeLists.txt.patch @@ -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" diff --git a/mygui/all/patches/3.4.1/AddLibPNG.patch b/mygui/all/patches/3.4.1/AddLibPNG.patch deleted file mode 100644 index 298d48f..0000000 --- a/mygui/all/patches/3.4.1/AddLibPNG.patch +++ /dev/null @@ -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 diff --git a/mygui/all/patches/3.4.1/CMakeLists.txt.patch b/mygui/all/patches/3.4.1/CMakeLists.txt.patch index ced9fbb..ab4106a 100644 --- a/mygui/all/patches/3.4.1/CMakeLists.txt.patch +++ b/mygui/all/patches/3.4.1/CMakeLists.txt.patch @@ -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"