-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[ogre] Fix include path in usage #19520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,31 +21,27 @@ vcpkg_from_github( | |
|
|
||
| file(REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake") | ||
|
|
||
| if (VCPKG_LIBRARY_LINKAGE STREQUAL static) | ||
| set(OGRE_STATIC ON) | ||
| else() | ||
| set(OGRE_STATIC OFF) | ||
| endif() | ||
| string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OGRE_STATIC) | ||
|
|
||
| # Configure features | ||
|
|
||
| vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
| d3d9 OGRE_BUILD_RENDERSYSTEM_D3D9 | ||
| java OGRE_BUILD_COMPONENT_JAVA | ||
| python OGRE_BUILD_COMPONENT_PYTHON | ||
| csharp OGRE_BUILD_COMPONENT_CSHARP | ||
| overlay OGRE_BUILD_COMPONENT_OVERLAY | ||
| zziplib OGRE_CONFIG_ENABLE_ZIP | ||
| strict OGRE_RESOURCEMANAGER_STRICT | ||
| FEATURES | ||
| d3d9 OGRE_BUILD_RENDERSYSTEM_D3D9 | ||
| java OGRE_BUILD_COMPONENT_JAVA | ||
| python OGRE_BUILD_COMPONENT_PYTHON | ||
| csharp OGRE_BUILD_COMPONENT_CSHARP | ||
| overlay OGRE_BUILD_COMPONENT_OVERLAY | ||
| zziplib OGRE_CONFIG_ENABLE_ZIP | ||
| strict OGRE_RESOURCEMANAGER_STRICT | ||
| ) | ||
|
|
||
| # OGRE_RESOURCEMANAGER_STRICT need to be 0 for OFF and 1 for ON, because it is used 'as is' in sources | ||
| string(REPLACE "OGRE_RESOURCEMANAGER_STRICT=ON" "OGRE_RESOURCEMANAGER_STRICT=1" FEATURE_OPTIONS "${FEATURE_OPTIONS}") | ||
| string(REPLACE "OGRE_RESOURCEMANAGER_STRICT=OFF" "OGRE_RESOURCEMANAGER_STRICT=0" FEATURE_OPTIONS "${FEATURE_OPTIONS}") | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| OPTIONS | ||
| -DOGRE_BUILD_DEPENDENCIES=OFF | ||
| -DOGRE_BUILD_SAMPLES=OFF | ||
|
|
@@ -65,7 +61,6 @@ vcpkg_configure_cmake( | |
| -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 | ||
| -DFREETYPE_FOUND=ON | ||
| # Optional stuff | ||
|
|
@@ -74,57 +69,59 @@ vcpkg_configure_cmake( | |
| -DOGRE_CMAKE_DIR=share/ogre | ||
| ) | ||
|
|
||
| vcpkg_install_cmake() | ||
| vcpkg_fixup_cmake_targets() | ||
| vcpkg_cmake_install() | ||
| vcpkg_cmake_config_fixup() | ||
|
|
||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
|
||
| file(GLOB REL_CFGS ${CURRENT_PACKAGES_DIR}/bin/*.cfg) | ||
| file(GLOB REL_CFGS "${CURRENT_PACKAGES_DIR}/bin/*.cfg") | ||
| if(REL_CFGS) | ||
| file(COPY ${REL_CFGS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) | ||
| file(COPY ${REL_CFGS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
| file(REMOVE ${REL_CFGS}) | ||
| endif() | ||
|
|
||
| file(GLOB DBG_CFGS ${CURRENT_PACKAGES_DIR}/debug/bin/*.cfg) | ||
| file(GLOB DBG_CFGS "${CURRENT_PACKAGES_DIR}/debug/bin/*.cfg") | ||
| if(DBG_CFGS) | ||
| file(COPY ${DBG_CFGS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) | ||
| file(COPY ${DBG_CFGS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
| file(REMOVE ${DBG_CFGS}) | ||
| endif() | ||
|
|
||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
| endif() | ||
|
|
||
| #Remove OgreMain*.lib from lib/ folder, because autolink would complain, since it defines a main symbol | ||
| #manual-link subfolder is here to the rescue! | ||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release") | ||
| file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) | ||
| file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link") | ||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib) | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib") | ||
| else() | ||
| file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib) | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib") | ||
| endif() | ||
| endif() | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug") | ||
| file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) | ||
| file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link") | ||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib) | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib") | ||
| else() | ||
| file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMainStatic_d.lib) | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMainStatic_d.lib") | ||
| endif() | ||
| endif() | ||
|
|
||
| file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/ogre/*.cmake) | ||
| file(GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/ogre/*.cmake") | ||
| foreach(SHARE_FILE ${SHARE_FILES}) | ||
| file(READ "${SHARE_FILE}" _contents) | ||
| string(REPLACE "lib/OgreMain" "lib/manual-link/OgreMain" _contents "${_contents}") | ||
| file(WRITE "${SHARE_FILE}" "${_contents}") | ||
| endforeach() | ||
| endif() | ||
|
|
||
| vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/OGRE/Bites/OgreSGTechniqueResolverListener.h" "OgreRTShaderSystem.h" "../RTShaderSystem/OgreRTShaderSystem.h") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a bug in upstream, has it been reported there?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also it seems unlikely that this is the only header affected; in the issue report the user says that they would have to edit "hundreds of header files", not only this one. I'm not positive what the correct fix is but I don't think this is.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out. Since this only affects the usage in the project. I'm not sure if this is a upstream bug. In user's project sample, there is only one place that needs to update. For other header files, it is due to the user didn't include the header path correctly in his project. The same kinds of problem may be also in other header files. I also have no better way to solve this. I'll report this problem to upstream.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. upstream issue OGRECave/ogre#2172 |
||
|
|
||
| # Handle copyright | ||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
|
|
||
| vcpkg_copy_pdbs() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this option doesn't exist on the current source codes.