Skip to content

Commit

Permalink
Add Ubuntu Jammy CI (gazebosim#577)
Browse files Browse the repository at this point in the history
* Use libogre-next-dev on jammy

Specify different package names for ogre2.2
in distro-specific packages-*.apt files.

* Find OGRE-Next with plain cmake

Patch adapted from gazebo-release/gz-rendering6-release#8

Signed-off-by: Steve Peters <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
  • Loading branch information
scpeters and chapulina authored Mar 21, 2022
1 parent 2016cd8 commit f043b4f
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/ci/packages-bionic.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libogre-2.2-dev
1 change: 1 addition & 0 deletions .github/ci/packages-focal.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libogre-2.2-dev
1 change: 1 addition & 0 deletions .github/ci/packages-jammy.apt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libogre-next-dev
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ libignition-math6-dev
libignition-math6-eigen3-dev
libignition-plugin-dev
libogre-1.9-dev
libogre-2.2-dev
libxi-dev
libxmu-dev
uuid-dev
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ jobs:
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,21 @@ if (OGRE_FOUND)
endif()

#--------------------------------------
# Find OGRE2
ign_find_package(IgnOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)

if (OGRE2_FOUND)
# Find OGRE-Next
find_package(OGRE-Next QUIET)
if (OGRE-Next_FOUND)
set(HAVE_OGRE2 TRUE)
set(HAVE_OGRE-Next TRUE)
else()
# Find OGRE2
ign_find_package(IgnOGRE2 VERSION 2.2.0
COMPONENTS HlmsPbs HlmsUnlit Overlay
REQUIRED_BY ogre2
PRIVATE_FOR ogre2)

if (OGRE2_FOUND)
set(HAVE_OGRE2 TRUE)
endif()
endif()

# Plugin install dirs
Expand Down
23 changes: 21 additions & 2 deletions ogre2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ set_property(
OGRE2_VERSION="${OGRE2_VERSION}"
)

if (HAVE_OGRE-Next)
target_include_directories(${ogre2_target}
PUBLIC
${OGRE-Next_INCLUDE_DIRS}
${OGRE-Next_HlmsUnlit_INCLUDE_DIRS}
${OGRE-Next_HlmsPbs_INCLUDE_DIRS}/../Common
)
endif()

target_include_directories(${ogre2_target}
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)

target_link_libraries(${ogre2_target}
Expand All @@ -39,7 +48,17 @@ target_link_libraries(${ogre2_target}
ignition-plugin${IGN_PLUGIN_VER}::register
${OPENGL_LIBRARIES}
terra
IgnOGRE2::IgnOGRE2)
)

if (HAVE_OGRE-Next)
target_link_libraries(${ogre2_target}
PRIVATE
${OGRE-Next_LIBRARIES})
else()
target_link_libraries(${ogre2_target}
PRIVATE
IgnOGRE2::IgnOGRE2)
endif()

set (versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
set (unversioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_NO_VERSION_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand Down
30 changes: 24 additions & 6 deletions ogre2/src/terrain/Terra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,31 @@ add_definitions(-DOGRE_IGNORE_UNKNOWN_DEBUG)
# $<$<CONFIG:Debug>:DEBUG=1 _DEBUG=1>)

target_include_directories(${PROJECT_NAME}
PRIVATE
# Hlms files inside Hlms/Pbs do not have #include <Hlms/Pbs/...> thus
# we must add this one manually for this to build correctly
${OGRE2_INCLUDE}/Hlms/Pbs
${OGRE2_INCLUDE}/Hlms/Common
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/include
)

target_link_libraries(${PROJECT_NAME} PRIVATE IgnOGRE2::IgnOGRE2)
if (HAVE_OGRE-Next)
target_include_directories(${PROJECT_NAME}
PRIVATE
# Hlms files inside Hlms/Pbs do not have #include <Hlms/Pbs/...> thus
# we must add this one manually for this to build correctly
${OGRE-Next_INCLUDE_DIRS}
${OGRE-Next_INCLUDE_DIRS}/OGRE-Next/PlanarReflections
${OGRE-Next_HlmsPbs_INCLUDE_DIRS}
${OGRE-Next_HlmsPbs_INCLUDE_DIRS}/..
${OGRE-Next_HlmsPbs_INCLUDE_DIRS}/../Common
)

target_link_libraries(${PROJECT_NAME} PRIVATE ${OGRE-Next_LIBRARIES})
else()
target_include_directories(${PROJECT_NAME}
PRIVATE
# Hlms files inside Hlms/Pbs do not have #include <Hlms/Pbs/...> thus
# we must add this one manually for this to build correctly
${OGRE2_INCLUDE}/Hlms/Pbs
${OGRE2_INCLUDE}/Hlms/Common
)

target_link_libraries(${PROJECT_NAME} PRIVATE IgnOGRE2::IgnOGRE2)
endif()

0 comments on commit f043b4f

Please sign in to comment.