mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 20:06:09 +08:00
Merge pull request #2092 from lazyhamster/ogre_1_10
[ogre] Update port to Ogre version 1.10.8.
This commit is contained in:
commit
71be72e11d
@ -1,17 +0,0 @@
|
||||
diff --git a/OgreMain/CMakeLists.txt b/OgreMain/CMakeLists.txt
|
||||
index 6a43378..22f950e 100644
|
||||
--- a/OgreMain/CMakeLists.txt
|
||||
+++ b/OgreMain/CMakeLists.txt
|
||||
@@ -220,7 +220,11 @@ endif ()
|
||||
list(APPEND HEADER_FILES ${THREAD_HEADER_FILES})
|
||||
|
||||
# Add needed definitions and nedmalloc include dir
|
||||
-add_definitions(-DOGRE_NONCLIENT_BUILD -DFREEIMAGE_LIB -D_MT -D_USRDLL)
|
||||
+# vcpkg specific patch: we removed -DFREEIMAGE_LIB
|
||||
+# from the defines, because vcpkg's freeimage can
|
||||
+# be both static or dynamic, and FREEIMAGE_LIB
|
||||
+# remove all the symbol exporting declaration from FreeImage.h
|
||||
+add_definitions(-DOGRE_NONCLIENT_BUILD -D_MT -D_USRDLL)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/nedmalloc)
|
||||
|
||||
set(LIBRARIES ${PLATFORM_LIBS})
|
@ -1,19 +0,0 @@
|
||||
diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt
|
||||
index 4c496b7..feb4017 100644
|
||||
--- a/CMake/CMakeLists.txt
|
||||
+++ b/CMake/CMakeLists.txt
|
||||
@@ -14,10 +14,12 @@
|
||||
#############################################################
|
||||
|
||||
if(WIN32 OR APPLE)
|
||||
- set(OGRE_CMAKE_DIR "CMake")
|
||||
+ set(OGRE_DEFAULT_CMAKE_DIR "CMake")
|
||||
else()
|
||||
- set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
|
||||
+ set(OGRE_DEFAULT_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
|
||||
endif()
|
||||
+set(OGRE_CMAKE_DIR ${OGRE_DEFAULT_CMAKE_DIR} CACHE STRING "Install directory for CMake files.")
|
||||
+mark_as_advanced(OGRE_DEFAULT_CMAKE_DIR)
|
||||
|
||||
set(INST_FILES
|
||||
Packages/FindOIS.cmake
|
@ -1,41 +0,0 @@
|
||||
diff --git a/CMake/Utils/OgreConfigTargets.cmake b/CMake/Utils/OgreConfigTargets.cmake
|
||||
index c6b3b40..2da7ebf 100644
|
||||
--- a/CMake/Utils/OgreConfigTargets.cmake
|
||||
+++ b/CMake/Utils/OgreConfigTargets.cmake
|
||||
@@ -41,15 +41,28 @@ if (NOT OGRE_RUNTIME_OUTPUT)
|
||||
set(OGRE_RUNTIME_OUTPUT ${OGRE_BINARY_DIR}/bin)
|
||||
endif ()
|
||||
|
||||
+option(OGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32 "Do not install in configuration-specific directories in Windows" FALSE)
|
||||
+
|
||||
if (WIN32)
|
||||
- set(OGRE_RELEASE_PATH "/Release")
|
||||
- set(OGRE_RELWDBG_PATH "/RelWithDebInfo")
|
||||
- set(OGRE_MINSIZE_PATH "/MinSizeRel")
|
||||
- set(OGRE_DEBUG_PATH "/Debug")
|
||||
- set(OGRE_LIB_RELEASE_PATH "/Release")
|
||||
- set(OGRE_LIB_RELWDBG_PATH "/RelWithDebInfo")
|
||||
- set(OGRE_LIB_MINSIZE_PATH "/MinSizeRel")
|
||||
- set(OGRE_LIB_DEBUG_PATH "/Debug")
|
||||
+ if (OGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32)
|
||||
+ set(OGRE_RELEASE_PATH "")
|
||||
+ set(OGRE_RELWDBG_PATH "")
|
||||
+ set(OGRE_MINSIZE_PATH "")
|
||||
+ set(OGRE_DEBUG_PATH "")
|
||||
+ set(OGRE_LIB_RELEASE_PATH "")
|
||||
+ set(OGRE_LIB_RELWDBG_PATH "")
|
||||
+ set(OGRE_LIB_MINSIZE_PATH "")
|
||||
+ set(OGRE_LIB_DEBUG_PATH "/")
|
||||
+ else ()
|
||||
+ set(OGRE_RELEASE_PATH "/Release")
|
||||
+ set(OGRE_RELWDBG_PATH "/RelWithDebInfo")
|
||||
+ set(OGRE_MINSIZE_PATH "/MinSizeRel")
|
||||
+ set(OGRE_DEBUG_PATH "/Debug")
|
||||
+ set(OGRE_LIB_RELEASE_PATH "/Release")
|
||||
+ set(OGRE_LIB_RELWDBG_PATH "/RelWithDebInfo")
|
||||
+ set(OGRE_LIB_MINSIZE_PATH "/MinSizeRel")
|
||||
+ set(OGRE_LIB_DEBUG_PATH "/Debug")
|
||||
+ endif ()
|
||||
set(OGRE_PLUGIN_PATH "/opt")
|
||||
set(OGRE_SAMPLE_PATH "/opt/samples")
|
||||
elseif (UNIX)
|
46
ports/ogre/001-cmake-install-dir.patch
Normal file
46
ports/ogre/001-cmake-install-dir.patch
Normal file
@ -0,0 +1,46 @@
|
||||
diff --git a/CMake/CMakeLists.txt b/CMake/CMakeLists.txt
|
||||
index 3382de139..404c56e5e 100644
|
||||
--- a/CMake/CMakeLists.txt
|
||||
+++ b/CMake/CMakeLists.txt
|
||||
@@ -13,10 +13,12 @@
|
||||
# directory, but can also be used for custom projects.
|
||||
#############################################################
|
||||
|
||||
-if(WIN32 OR APPLE)
|
||||
- set(OGRE_CMAKE_DIR "CMake")
|
||||
-else()
|
||||
- set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
|
||||
+if (NOT DEFINED OGRE_CMAKE_DIR)
|
||||
+ if(WIN32 OR APPLE)
|
||||
+ set(OGRE_CMAKE_DIR "CMake")
|
||||
+ else()
|
||||
+ set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
set(INST_FILES
|
||||
diff --git a/CMake/InstallResources.cmake b/CMake/InstallResources.cmake
|
||||
index 0181259e2..346188c73 100644
|
||||
--- a/CMake/InstallResources.cmake
|
||||
+++ b/CMake/InstallResources.cmake
|
||||
@@ -245,12 +245,14 @@ endif ()
|
||||
# Create the CMake package files
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
-if (WIN32)
|
||||
- set(OGRE_CMAKE_DIR CMake)
|
||||
-elseif (UNIX)
|
||||
- set(OGRE_CMAKE_DIR lib/OGRE/cmake)
|
||||
-elseif (APPLE)
|
||||
-endif ()
|
||||
+if (NOT DEFINED OGRE_CMAKE_DIR)
|
||||
+ if (WIN32)
|
||||
+ set(OGRE_CMAKE_DIR CMake)
|
||||
+ elseif (UNIX)
|
||||
+ set(OGRE_CMAKE_DIR lib/OGRE/cmake)
|
||||
+ elseif (APPLE)
|
||||
+ endif ()
|
||||
+endif()
|
||||
configure_package_config_file(${OGRE_TEMPLATES_DIR}/OGREConfig.cmake.in ${OGRE_BINARY_DIR}/cmake/OGREConfig.cmake
|
||||
INSTALL_DESTINATION ${OGRE_CMAKE_DIR}
|
||||
PATH_VARS CMAKE_INSTALL_PREFIX)
|
@ -1,4 +1,14 @@
|
||||
Source: ogre
|
||||
Version: 1.9.0-1
|
||||
Version: 1.10.9-1
|
||||
Build-Depends: freeimage, freetype, zlib, zziplib
|
||||
Description: 3D Object-Oriented Graphics Rendering Engine
|
||||
|
||||
Feature: d3d9
|
||||
Description: Build Direct3D9 RenderSystem
|
||||
|
||||
Feature: java
|
||||
Description: Build Java (JNI) bindings
|
||||
|
||||
Feature: python
|
||||
Description: Build Python bindings
|
||||
Build-Depends: python3
|
||||
|
@ -1,37 +0,0 @@
|
||||
#.rst:
|
||||
# OGREConfig
|
||||
# ------------
|
||||
#
|
||||
# Dummy OGREConfig to simplify use of OGRE-provided FindOGRE module.
|
||||
#
|
||||
# This file is provided as part of the vcpkg port of OGRE .
|
||||
# It is meant to be found automatically by find_package(OGRE),
|
||||
# but then offloads all the real work to the FindOGRE module by temporarly
|
||||
# adding its directory to CMAKE_MODULE_PATH
|
||||
#
|
||||
# See the FindOGRE module to see the defined variables::
|
||||
#
|
||||
|
||||
# Temporarly add the directory in which OGREConfig.cmake is contained to
|
||||
# get access to the FindOGRE module
|
||||
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${SELF_DIR})
|
||||
find_package(OGRE MODULE)
|
||||
|
||||
# Leave CMAKE_MODULE_PATH as we found it
|
||||
set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH})
|
||||
|
||||
# Handle components
|
||||
# imported from https://github.com/Kitware/CMake/blob/v3.7.1/Modules/CMakePackageConfigHelpers.cmake#L300
|
||||
macro(check_required_components _NAME)
|
||||
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
||||
if(NOT ${_NAME}_${comp}_FOUND)
|
||||
if(${_NAME}_FIND_REQUIRED_${comp})
|
||||
set(${_NAME}_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
check_required_components(OGRE)
|
@ -1,17 +1,19 @@
|
||||
include(vcpkg_common_functions)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sinbad-ogre-dd30349ea667)
|
||||
|
||||
set(OGRE_VERSION 1.10.9)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ogre-${OGRE_VERSION})
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip"
|
||||
FILENAME "ogre-v1-9-0.zip"
|
||||
SHA512 de7315a2450ecf0d9073e6a8f0c54737e041016f7ad820556d10701c7d23eefab9d3473476a8e95447c30ab21518b8e4cfb0271db72494ea67a3dea284c9a3d3
|
||||
URLS "https://github.com/OGRECave/ogre/archive/v${OGRE_VERSION}.zip"
|
||||
FILENAME "ogre-${OGRE_VERSION}.zip"
|
||||
SHA512 2e68b30da6dc2e1df6575970623a14057675b069536ed0ac87faeefc8e295965ff7427c99385f29ab803b02bd5294f6886293aabdd17ec8c92f80baf53587457
|
||||
)
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-use-vcpkg-freeimage.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/0002-ogre-cmake-dir-as-option.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/0003-use-flat-installation.patch"
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/001-cmake-install-dir.patch"
|
||||
)
|
||||
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
@ -20,41 +22,82 @@ else()
|
||||
set(OGRE_STATIC OFF)
|
||||
endif()
|
||||
|
||||
# Configure features
|
||||
|
||||
if("d3d9" IN_LIST FEATURES)
|
||||
set(WITH_D3D9 ON)
|
||||
else()
|
||||
set(WITH_D3D9 OFF)
|
||||
endif()
|
||||
|
||||
if("java" IN_LIST FEATURES)
|
||||
set(WITH_JAVA ON)
|
||||
else()
|
||||
set(WITH_JAVA OFF)
|
||||
endif()
|
||||
|
||||
if("python" IN_LIST FEATURES)
|
||||
set(WITH_PYTHON ON)
|
||||
else()
|
||||
set(WITH_PYTHON OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS -DOGRE_USE_BOOST:BOOL=OFF
|
||||
-DOGRE_BUILD_RENDERSYSTEM_D3D9:BOOL=OFF
|
||||
-DOGRE_INSTALL_DEPENDENCIES:BOOL=OFF
|
||||
-DOGRE_COPY_DEPENDENCIES:BOOL=OFF
|
||||
-DOGRE_BUILD_TOOLS:BOOL=OFF
|
||||
-DOGRE_CMAKE_DIR:STRING=share/ogre
|
||||
-DOGRE_STATIC:BOOL=${OGRE_STATIC}
|
||||
-DOGRE_INSTALL_SAMPLES:BOOL=OFF
|
||||
-DOGRE_INSTALL_TOOLS:BOOL=OFF
|
||||
# We disable this option because it is broken and we rely on vcpkg_copy_pdbs
|
||||
-DOGRE_INSTALL_PDB:BOOL=OFF
|
||||
-DOGRE_BUILD_DOCS:BOOL=OFF
|
||||
-DOGRE_INSTALL_DOCS:BOOL=OFF
|
||||
-DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=OFF
|
||||
-DOGRE_NO_INSTALLATION_SUFFIXES_ON_WIN32:BOOL=ON
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DOGRE_BUILD_DEPENDENCIES=OFF
|
||||
-DOGRE_BUILD_SAMPLES=OFF
|
||||
-DOGRE_BUILD_TESTS=OFF
|
||||
-DOGRE_BUILD_TOOLS=OFF
|
||||
-DOGRE_BUILD_MSVC_MP=ON
|
||||
-DOGRE_BUILD_MSVC_ZM=ON
|
||||
-DOGRE_INSTALL_DEPENDENCIES=OFF
|
||||
-DOGRE_INSTALL_DOCS=OFF
|
||||
-DOGRE_INSTALL_PDB=OFF
|
||||
-DOGRE_INSTALL_SAMPLES=OFF
|
||||
-DOGRE_INSTALL_TOOLS=OFF
|
||||
-DOGRE_INSTALL_CMAKE=ON
|
||||
-DOGRE_INSTALL_VSPROPS=OFF
|
||||
-DOGRE_STATIC=${OGRE_STATIC}
|
||||
-DOGRE_UNITY_BUILD=OFF
|
||||
-DOGRE_USE_STD11=ON
|
||||
-DOGRE_CONFIG_THREAD_PROVIDER=std
|
||||
-DOGRE_NODE_STORAGE_LEGACY=OFF
|
||||
-DOGRE_BUILD_RENDERSYSTEM_D3D11=ON
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GL=ON
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GLES=OFF
|
||||
-DOGRE_BUILD_RENDERSYSTEM_GLES2=OFF
|
||||
# Optional stuff
|
||||
-DOGRE_BUILD_COMPONENT_JAVA=${WITH_JAVA}
|
||||
-DOGRE_BUILD_COMPONENT_PYTHON=${WITH_PYTHON}
|
||||
-DOGRE_BUILD_RENDERSYSTEM_D3D9=${WITH_D3D9}
|
||||
# vcpkg specific stuff
|
||||
-DOGRE_CMAKE_DIR=share/ogre
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Add a OGREConfig.cmake to simplify the process of finding vcpkg OGRE
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/OGREConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre)
|
||||
|
||||
# Remove debug includes
|
||||
# Remove unwanted files
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Remove debug CMake files
|
||||
# Note that at the moment OGRE do not export imported targets,
|
||||
# so we do not need to copy the debug imported targets in the
|
||||
# release CMake path
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/ogre)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
|
||||
file(GLOB REL_CFGS ${CURRENT_PACKAGES_DIR}/bin/*.cfg)
|
||||
file(COPY ${REL_CFGS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
||||
|
||||
file(GLOB DBG_CFGS ${CURRENT_PACKAGES_DIR}/debug/bin/*.cfg)
|
||||
file(COPY ${DBG_CFGS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
||||
|
||||
file(REMOVE ${REL_CFGS} ${DBG_CFGS})
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
endif()
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ogre/COPYING ${CURRENT_PACKAGES_DIR}/share/ogre/copyright)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre RENAME copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
Loading…
Reference in New Issue
Block a user