🐛 Fixed OGRE build on windows

This commit is contained in:
Edgar 2021-08-06 17:18:52 +02:00
parent bfa980b20a
commit 642ef3dcd6
No known key found for this signature in database
GPG Key ID: 17D930BB616061A5
2 changed files with 34 additions and 1 deletions

View File

@ -1,12 +1,13 @@
sources:
"1.11.6.1":
url: "https://github.com/AnotherFoxGuy/ogre/archive/refs/tags/1.11.6.1.tar.gz"
sha256: "e58f2fc55bad64f75a43b309ccfaccdb0b9889fbed20547e51f10d7d4824ab9f"
sha256: "31c84051ffe9a3710c553cfa27ebda7b176c9dfe3b4d2a113d4f02caf48ecd5b"
patches:
"1.11.6.1":
- patch_file: "patches/1.11.6.1/CMakeLists.txt.patch"
- patch_file: "patches/1.11.6.1/Dependencies.cmake.patch"
- patch_file: "patches/1.11.6.1/Samples-CMakeList.txt.patch"
- patch_file: "patches/1.11.6.1/AddLibPNG.patch"
requirements:
- "zlib/[1.x]"
- "zziplib/[0.13.x]"

View File

@ -0,0 +1,32 @@
--- 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
@@ -21,7 +35,7 @@
# setup target
add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} ${PLATFORM_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_LIBRARIES}" ${PNG_LIBRARIES} ${BZIP2_LIBRARIES} ${BROTLI_LIBRARIES} ZLIB::ZLIB)
target_include_directories(OgreOverlay PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
$<INSTALL_INTERFACE:include/OGRE/Overlay>