-
Notifications
You must be signed in to change notification settings - Fork 33
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
Integrate Ogre-Next 3.x.x built from source #468
base: gz-cmake4
Are you sure you want to change the base?
Conversation
Signed-off-by: Ramir Sultanov <[email protected]>
Signed-off-by: Ramir Sultanov <[email protected]>
As it is related to #457, should I try to merge PS. Sorry for the commits related to a typo and obsolete documetation. For some strange reason I didn't notice it when I was reviewing my code. |
Signed-off-by: Ramir Sultanov <[email protected]>
|
||
message(STATUS "GzOGRE3_VERSION_EXACT: " ${GzOGRE3_VERSION_EXACT}) | ||
message(STATUS "GzOGRE3_VERSION_COMPATIBLE: " ${GzOGRE3_VERSION_COMPATIBLE}) | ||
endif() |
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.
Add else
just in case Ogre 3 is not installed or something happened
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.
added a comment on line 11. do we really need an else
block?
|
||
message(STATUS "Finding OGRE 3") | ||
|
||
gz_find_package(GzOGRE3 VERSION 3 |
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 we are adding a cmake for 3.0
and 3
. are there any differences ?
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.
in fact, i don't precisely know the reasons behind it. i looked at the examples/find_ogre2
directory, found the examples for multiple versions (2
, 2.1
, 2.2
, 2.3
) and tried to make a similar thing for ogre3. probably, it makes (manual) testing more complete in the sense not only a major version parameter is tested but also a minor version parameter is tested with several values. but it is duplicate code and i will reduce examples only to 3
then. we can add more examples later if needed.
|
||
message(STATUS "GzOGRE3_VERSION_EXACT: " ${GzOGRE3_VERSION_EXACT}) | ||
message(STATUS "GzOGRE3_VERSION_COMPATIBLE: " ${GzOGRE3_VERSION_COMPATIBLE}) | ||
endif() |
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.
same idea with the else
here
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.
same question here
gz_find_package(GzOGRE3 VERSION 3.0 | ||
COMPONENTS HlmsPbs HlmsUnlit Overlay Atmosphere) | ||
|
||
message(STATUS "OGRE3_FOUND: " ${OGRE3_FOUND}) |
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.
in case Ogre-Next 3
is not installed OGRE3_FOUND
will be FALSE
and the corresponding message will be displayed:
-- OGRE3_FOUND: FALSE
Signed-off-by: Ramir Sultanov <[email protected]>
As mentioned in #457 (comment) since OgreNext 3.0 it should be sufficient to just call |
Thanks @sumir0 for the PR ! The support for OGRE-3.x and gazebosim/gz-sim#2753 is really cool.
This is indeed a good idea. Even better would be that we can use the the CMake Module shipped directly by upstream as @traversaro mentioned. If you could give it a try, would be great.
No worries! |
I checked Output with OGRE (classic) installed alongside: -- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Checking for module 'OGRE-Next'
-- Package 'OGRE-Next' not found
-- Checking for module 'OGRE'
-- Found OGRE, version 14.3.2
-- Found Ogre (..)
-- Found OGRE: optimized;/usr/lib/libOgreMain.so;debug;/usr/local/lib/libOgreMain_d.so
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/libOgrePaging.so;debug;/usr/lib/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/libOgreTerrain.so;debug;/usr/lib/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/libOgreProperty.so;debug;/usr/lib/libOgreProperty.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/libOgreVolume.so;debug;/usr/lib/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/libOgreOverlay.so;debug;/usr/local/lib/libOgreOverlay_d.so
-- Looking for OGRE_HlmsPbs...
-- Could not locate OGRE_HlmsPbs
-- Looking for OGRE_HlmsUnlit...
-- Could not locate OGRE_HlmsUnlit Output with only OGRE-Next installed (with the Atmosphere component) from source: -- Looking for OGRE...
-- OGRE_PREFIX_WATCH changed.
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Checking for module 'OGRE-Next'
-- Package 'OGRE-Next' not found
-- Checking for module 'OGRE'
-- Package 'OGRE' not found
-- Found Ogre Eris (3.0.0)
-- Found OGRE: /usr/local/lib/libOgreMain_d.so
-- Looking for OGRE_Paging...
-- Could not locate OGRE_Paging
-- Looking for OGRE_Terrain...
-- Could not locate OGRE_Terrain
-- Looking for OGRE_Property...
-- Could not locate OGRE_Property
-- Looking for OGRE_Volume...
-- Could not locate OGRE_Volume
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: /usr/local/lib/libOgreOverlay_d.so
-- Looking for OGRE_HlmsPbs...
-- Found OGRE_HlmsPbs: /usr/local/lib/libOgreHlmsPbs_d.so
-- Looking for OGRE_HlmsUnlit...
-- Found OGRE_HlmsUnlit: /usr/local/lib/libOgreHlmsUnlit_d.so Thank you to all of you! I will convert this PR to draft for now. I will think about possibility of contributing to OGRE-Next, because I need the Atmosphere component for gazebosim/gz-sim#2753. Feel free to comment, any (good) advice would be appreciated. |
🎉 New feature
Related to Integrating Ogre-Next 3.0's atmosphere component
Summary
This PR allows Ogre-Next version 3.x.x to be found by using
gz_find_package
(for example:gz_find_package(GzOGRE3 VERSION 3)
. Only 3.x.x versions built from source are supported. The code is heavily based on thecmake/FindGzOGRE2.cmake
file and represents a reduced and slightly modified version of that file.Test it
pacman -S pkg-config
in a terminal. For Ubuntu a similar package probably is available.HlmsPbs
,HlmsUnlit
,Overlay
,Atmosphere
components are needed. To do thatcmake
needs to be run with several special parameters, for example:examples/find_ogre3/README.md
file.Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.