diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index a4f3cf6114..795ce24a7c 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -131,9 +131,11 @@ install( if(NOT IMGUI_SKIP_HEADERS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/imgui.h - ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h - ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h - ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imconfig.h + ${CMAKE_CURRENT_SOURCE_DIR}/imgui_internal.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_textedit.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_rectpack.h + ${CMAKE_CURRENT_SOURCE_DIR}/imstb_truetype.h ${CMAKE_CURRENT_SOURCE_DIR}/misc/cpp/imgui_stdlib.h DESTINATION include ) diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 88fb1440ce..75a46c25c4 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,6 +1,6 @@ Source: imgui Version: 1.77 -Port-Version: 1 +Port-Version: 2 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL deleted file mode 100644 index 521f13f173..0000000000 --- a/ports/ogre/CONTROL +++ /dev/null @@ -1,18 +0,0 @@ -Source: ogre -Version: 1.12.1-1 -Build-Depends: freeimage, freetype, zlib, zziplib -Homepage: https://github.com/OGRECave/ogre -Description: 3D Object-Oriented Graphics Rendering Engine - -Feature: d3d9 -Description: Build Direct3D9 RenderSystem - -Feature: csharp -Description: Build csharp bindings - -Feature: java -Description: Build Java (JNI) bindings - -Feature: python -Description: Build Python bindings -Build-Depends: python3 diff --git a/ports/ogre/fix-dependency.patch b/ports/ogre/fix-dependency.patch new file mode 100644 index 0000000000..ba7e7516de --- /dev/null +++ b/ports/ogre/fix-dependency.patch @@ -0,0 +1,45 @@ +diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake +index 959fdf5..dcd28bb 100644 +--- a/CMake/Dependencies.cmake ++++ b/CMake/Dependencies.cmake +@@ -217,7 +217,7 @@ find_package(FreeImage) + macro_log_feature(FreeImage_FOUND "freeimage" "Support for commonly used graphics image formats" "http://freeimage.sourceforge.net" FALSE "" "") + + # Find FreeType +-find_package(Freetype) ++find_package(freetype CONFIG REQUIRED) + macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "") + + # Find X11 +@@ -291,7 +291,7 @@ macro_log_feature(SWIG_FOUND "SWIG" "Language bindings (Python, Java, C#) for OG + # Find sdl2 + if(NOT ANDROID AND NOT EMSCRIPTEN) + # find script does not work in cross compilation environment +- find_package(SDL2 QUIET) ++ find_package(SDL2 CONFIG REQUIRED) + macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "") + if(SDL2_FOUND AND NOT TARGET SDL2::SDL2) + add_library(SDL2::SDL2 INTERFACE IMPORTED) +diff --git a/PlugIns/DotScene/CMakeLists.txt b/PlugIns/DotScene/CMakeLists.txt +index fd285df..ab8e9c1 100644 +--- a/PlugIns/DotScene/CMakeLists.txt ++++ b/PlugIns/DotScene/CMakeLists.txt +@@ -1,4 +1,4 @@ +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h") + list(APPEND HEADER_FILES ${PROJECT_BINARY_DIR}/include/OgreDotScenePluginExports.h) +diff --git a/Tools/XMLConverter/CMakeLists.txt b/Tools/XMLConverter/CMakeLists.txt +index 8fe9683..2a516b2 100644 +--- a/Tools/XMLConverter/CMakeLists.txt ++++ b/Tools/XMLConverter/CMakeLists.txt +@@ -22,7 +22,7 @@ set(SOURCE_FILES + ) + + # allow override by cmake +-find_package(pugixml QUIET) ++find_package(pugixml CONFIG REQUIRED) + + add_executable(OgreXMLConverter ${HEADER_FILES} ${SOURCE_FILES}) + target_include_directories(OgreXMLConverter PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/ports/ogre/fix-findimgui.patch b/ports/ogre/fix-findimgui.patch new file mode 100644 index 0000000000..efd30d061e --- /dev/null +++ b/ports/ogre/fix-findimgui.patch @@ -0,0 +1,35 @@ +diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt +index 1cea873..d3e756e 100644 +--- a/Components/Overlay/CMakeLists.txt ++++ b/Components/Overlay/CMakeLists.txt +@@ -19,12 +19,8 @@ list(APPEND HEADER_FILES + file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + + if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) +- list(APPEND SOURCE_FILES +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_draw.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_widgets.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/imgui_demo.cpp +- ${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/misc/freetype/imgui_freetype.cpp) ++ find_package(imgui CONFIG REQUIRED) ++ find_path(IMGUI_INCLUDE_DIR imgui.h) + else() + list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreImGuiOverlay.cpp") + endif() +@@ -32,13 +28,13 @@ endif() + # 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_LIBRARIES} ZLIB::ZLIB imgui::imgui) + target_include_directories(OgreOverlay PUBLIC + "$" + $ + PRIVATE ${FREETYPE_INCLUDE_DIRS}) + +-if(OGRE_BUILD_COMPONENT_OVERLAY_IMGUI) ++if(0) + target_include_directories(OgreOverlay PUBLIC + PUBLIC "$" + PRIVATE "$") diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake index f5faac14b8..408ce416bf 100644 --- a/ports/ogre/portfile.cmake +++ b/ports/ogre/portfile.cmake @@ -9,11 +9,13 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OGRECave/ogre - REF 8083067c1835147de5d82015347d95c710e36bc0 - SHA512 0690aaff0bea74c38598894939396cab8077b84bda166deb4790fba87566114bc5267660e8efc4de9babeb1b8bddf73530e1a1dbbc63c7e24b14bc012b033bc8 + REF 8ff1a4046716244fc4b3a3e44e5b6abeda755b0a #v1.12.7 + SHA512 60c66118e35904cbabe881301f3e59026483507341450956f99b67220e1aaebd7035caac69c3e06cf45f08163254264da111b93d0c6b3402c3fba64858786b66 HEAD_REF master PATCHES toolchain_fixes.patch + fix-dependency.patch + fix-findimgui.patch ) file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake") diff --git a/ports/ogre/toolchain_fixes.patch b/ports/ogre/toolchain_fixes.patch index 9ff2d87dfe..cae36e1ebb 100644 --- a/ports/ogre/toolchain_fixes.patch +++ b/ports/ogre/toolchain_fixes.patch @@ -20,10 +20,10 @@ index a7a3796..2e21403 100644 set(INST_FILES Utils/FindPkgMacros.cmake) diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake -index 783755e..79f7514 100644 +index 06a055b..09d10bd 100644 --- a/CMake/InstallResources.cmake +++ b/CMake/InstallResources.cmake -@@ -208,10 +208,12 @@ endif () +@@ -201,10 +201,12 @@ endif () # Create the CMake package files include(CMakePackageConfigHelpers) @@ -38,8 +38,8 @@ index 783755e..79f7514 100644 + set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake") + endif() endif() - configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${PROJECT_BINARY_DIR}/cmake/OGREConfig.cmake - INSTALL_DESTINATION ${OGRE_CMAKE_DIR} + if(WIN32) + set(OGRE_PLUGIN_DIR_CMAKE "bin") diff --git a/CMake/Packages/FindCg.cmake b/CMake/Packages/FindCg.cmake index 4501cf9..7eb57c3 100644 --- a/CMake/Packages/FindCg.cmake @@ -93,7 +93,7 @@ index 7125895..13a306f 100644 findpkg_finish(HLSL2GLSL) add_parent_dir(HLSL2GLSL_INCLUDE_DIRS HLSL2GLSL_INCLUDE_DIR) diff --git a/CMake/Packages/FindNVAPI.cmake b/CMake/Packages/FindNVAPI.cmake -index 2b9deba..f33a298 100644 +index 95c70cd..893ce01 100644 --- a/CMake/Packages/FindNVAPI.cmake +++ b/CMake/Packages/FindNVAPI.cmake @@ -44,7 +44,7 @@ findpkg_framework(NVAPI) @@ -238,10 +238,10 @@ index 374f84b..dc7066d 100644 # Generate debug names from given release names diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3e09d2d..58968f0 100644 +index 1602572..9fddbe7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -274,7 +274,7 @@ elseif(EMSCRIPTEN) +@@ -269,7 +269,7 @@ elseif(EMSCRIPTEN) elseif (APPLE AND NOT APPLE_IOS) set(XCODE_ATTRIBUTE_SDKROOT macosx) @@ -250,32 +250,6 @@ index 3e09d2d..58968f0 100644 execute_process(COMMAND xcodebuild -version -sdk "${XCODE_ATTRIBUTE_SDKROOT}" Path | head -n 1 OUTPUT_VARIABLE CMAKE_OSX_SYSROOT) string(REGEX REPLACE "(\r?\n)+$" "" CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}") else() -diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt -index bdb303d..d9cc221 100644 ---- a/Components/Overlay/CMakeLists.txt -+++ b/Components/Overlay/CMakeLists.txt -@@ -21,7 +21,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") - # 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} ZLIB::ZLIB) - target_include_directories(OgreOverlay PUBLIC - "$" - $ -diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt -index 6ec4e34..cc9cb9d 100644 ---- a/OgreMain/CMakeLists.txt -+++ b/OgreMain/CMakeLists.txt -@@ -225,8 +225,6 @@ if (APPLE) - set_target_properties(OgreMain PROPERTIES - LINK_FLAGS "-framework IOKit -framework Cocoa -framework Carbon -framework OpenGL -framework CoreVideo" - ) -- -- set(OGRE_OSX_BUILD_CONFIGURATION "$(PLATFORM_NAME)/$(CONFIGURATION)") - - if(OGRE_BUILD_LIBS_AS_FRAMEWORKS) - add_custom_command(TARGET OgreMain POST_BUILD diff --git a/PlugIns/EXRCodec/CMakeLists.txt b/PlugIns/EXRCodec/CMakeLists.txt index e9c936a..bb8747e 100644 --- a/PlugIns/EXRCodec/CMakeLists.txt diff --git a/ports/ogre/vcpkg.json b/ports/ogre/vcpkg.json new file mode 100644 index 0000000000..d7f0fa2767 --- /dev/null +++ b/ports/ogre/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "ogre", + "version-string": "1.12.7", + "description": "3D Object-Oriented Graphics Rendering Engine", + "homepage": "https://github.com/OGRECave/ogre", + "dependencies": [ + "freeimage", + "freetype", + "zlib", + "zziplib", + "sdl2", + "pugixml", + { + "name": "imgui", + "features": [ + "freetype" + ] + } + ], + "features": [ + { + "name": "d3d9", + "description": "Build Direct3D9 RenderSystem" + }, + { + "name": "csharp", + "description": "Build csharp bindings" + }, + { + "name": "java", + "description": "Build Java (JNI) bindings" + }, + { + "name": "python", + "description": "Build Python bindings", + "dependencies": [ + "python3" + ] + } + ] +}