Skip to content
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

[FindGzOgreNext] Support Ogre 3.x and beyond #457

Open
oysstu opened this issue Oct 29, 2024 · 4 comments
Open

[FindGzOgreNext] Support Ogre 3.x and beyond #457

oysstu opened this issue Oct 29, 2024 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@oysstu
Copy link

oysstu commented Oct 29, 2024

The ogre-next project has released the next major version (v3.0.0 Eris). It seems that from now on, the project will follow a more conventional semver strategy, where new development is focused on the next major version.

Currently the FindGzOgre2 is hard-coded to find ogre-next releases with major version 2.x.x. It would probably be a good idea to generalize this to FindGzOgreNext. The "USE_NEW_PROJECT_NAME" feature was merged in v2.3.3, so support for v2.3.2 and earlier should probably be left to the existing FindGzOgre2 or dropped completely.

@oysstu oysstu added the enhancement New feature or request label Oct 29, 2024
@oysstu oysstu changed the title [FindGzOgreX] Support Ogre 3.x and beyond [FindGzOgreNext] Support Ogre 3.x and beyond Oct 29, 2024
@j-rivero
Copy link
Contributor

Wow these are good news! The FindGzOgreNext needs a good cleanup and we should try to use plain CMake modules from upstream. I can happily review code changes for this. Thanks @oysstu !

@j-rivero j-rivero added the help wanted Extra attention is needed label Oct 29, 2024
@oysstu
Copy link
Author

oysstu commented Oct 30, 2024

I had a quick look at the ogre-next cmake setup, and it looks like they're not using modern cmake packaging conventions yet. Ideally, they would export the targets and components in a package config in ../share/cmake/. Instead, there's pkg-config files tied together by a big FindOGRE.cmake module in ../lib/../OGRE-Next/cmake.

The way I see it there's two possibilities

  • Make the current FindGzOgre functionality work for 3.0.0+. E.g., remove hard checks for version 2 and rename OGRE2 variables to OGRE_NEXT. Remove workarounds for the old-style project layout, if any (e.g. before the move to 'Next').
  • Try to rework FindGzOgreNext around the upstream FindOGRE.cmake module instead of utilizing the pkgconfig files directly

The upstream FindOGRE module has been around for a long time though, so I'm sure there's a reason the latter hasn't been done before.

@iche033
Copy link
Contributor

iche033 commented Oct 30, 2024

when I wrote the original version using pkg-config many years ago I remember it's because the upstream find ogre module would not always find the correct ogre version or the right ogre plugin libraries. With the new ogre-next name change, things may be different. I think it's a good idea to use the upstream module instead of custom pkg-config code.

@oysstu
Copy link
Author

oysstu commented Nov 17, 2024

I've created an issue in ogre-next (OGRECave/ogre-next#470). Their FindOGRE file still doesn't work well when both ogre-next and ogre is installed. Pkgconfig on the other hand behaves the same even if ogre is installed alongside ogre-next.

I.e., the following prints the same variable definitions even if ogre is installed.

cmake_minimum_required(VERSION 3.22)
project(ogre-test)

find_package(PkgConfig REQUIRED)
pkg_check_modules(OGRE_NEXT OGRE-Next REQUIRED)
pkg_check_modules(OGRE_NEXT_HLMS OGRE-Next-Hlms REQUIRED)
pkg_check_modules(OGRE_NEXT_OVERLAY OGRE-Next-Overlay REQUIRED)

get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
    message(STATUS "${_variableName}=${${_variableName}}")
endforeach()

Also, the pkgconfig files are installed in a standard location, whereas the FindOGRE.cmake install location is non-standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Inbox
Development

No branches or pull requests

3 participants