Skip to content

Commit f6faf50

Browse files
authored
Merge pull request #1538 from rolalaro/ogre-1_12
Compatibility with more recent versions of Ogre
2 parents 2f13b74 + cae757c commit f6faf50

28 files changed

Lines changed: 1328 additions & 559 deletions
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Ubuntu-ogre-apt
2+
3+
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
schedule:
8+
- cron: '0 2 * * SUN'
9+
10+
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-ubuntu-ogre-apt:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-22.04, ubuntu-latest]
23+
compiler: [ {CC: /usr/bin/gcc-9, CXX: /usr/bin/g++-9}, {CC: /usr/bin/gcc-10, CXX: /usr/bin/g++-10}, {CC: /usr/bin/clang, CXX: /usr/bin/clang++} ]
24+
standard: [ 11, 17 ]
25+
ogre: [ogre-1.9, ogre-1.12]
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Print system information
32+
run: lscpu
33+
34+
- name: Print OS information
35+
run: lsb_release -a
36+
37+
- name: Print compiler information
38+
run: dpkg --list | grep compiler
39+
40+
- name: Install ViSP dependencies
41+
run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev
42+
43+
- name: Install Ogre 1.9
44+
if: matrix.ogre == 'ogre-1.9' && matrix.standard != '17'
45+
run: sudo apt-get update && sudo apt-get install -y libogre-1.9-dev
46+
47+
- name: Install Ogre 1.12
48+
if: matrix.ogre == 'ogre-1.12'
49+
run: sudo apt-get update && sudo apt-get install -y libogre-1.12-dev
50+
51+
- name: Clone visp-images
52+
env:
53+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
54+
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
55+
run: |
56+
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
57+
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV
58+
echo ${VISP_INPUT_IMAGE_PATH}
59+
60+
- name: Clone visp_sample
61+
run: |
62+
git clone --depth 1 https://github.com/lagadic/visp_sample ${HOME}/visp_sample
63+
64+
- name: Configure CMake
65+
run: |
66+
mkdir build
67+
cd build
68+
CC=${{ matrix.compiler.CC }}
69+
CXX=${{ matrix.compiler.CXX }}
70+
CXX_STANDARD=${{ matrix.standard }}
71+
echo "CC: $CC"
72+
echo "CXX: $CXX"
73+
echo "Standard: $CXX_STANDARD"
74+
cmake .. -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/usr/local -DCMAKE_VERBOSE_MAKEFILE=ON -DUSE_CXX_STANDARD=$CXX_STANDARD
75+
cat ViSP-third-party.txt
76+
77+
- name: Compile
78+
working-directory: build
79+
run: |
80+
make -j$(nproc) install
81+
82+
- name: Run unit tests
83+
working-directory: build
84+
run: ctest -j$(nproc) --output-on-failure
85+
86+
- name: ViSP as 3rdparty with cmake
87+
run: |
88+
cd ${HOME}/visp_sample
89+
mkdir visp_sample-build
90+
cd visp_sample-build
91+
CC=${{ matrix.compiler.CC }}
92+
CXX=${{ matrix.compiler.CXX }}
93+
cmake .. -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DVISP_DIR=/tmp/usr/local/lib/cmake/visp -DCMAKE_VERBOSE_MAKEFILE=ON
94+
make -j$(nproc)
95+
96+
- name: ViSP as 3rdparty with visp.pc and pkg-config
97+
run: |
98+
cd ${HOME}/visp_sample
99+
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
100+
CC=${{ matrix.compiler.CC }}
101+
CXX=${{ matrix.compiler.CXX }}
102+
pkg-config --cflags visp
103+
pkg-config --libs visp
104+
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc
105+
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc clean
106+
107+
- name: ViSP as 3rdparty with visp-config
108+
run: |
109+
cd ${HOME}/visp_sample
110+
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig
111+
export VISP_INSTALL_PREFIX=/tmp/usr/local
112+
CC=${{ matrix.compiler.CC }}
113+
CXX=${{ matrix.compiler.CXX }}
114+
$VISP_INSTALL_PREFIX/bin/visp-config --cflags
115+
$VISP_INSTALL_PREFIX/bin/visp-config --libs
116+
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config
117+
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config clean
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Ubuntu-ogre-src
2+
3+
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
4+
on:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
schedule:
8+
- cron: '0 2 * * SUN'
9+
10+
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
env:
17+
# Function to get the most recent tag of a remote repository without having to clone it, excluding tag with 'pr' as in Pre Release
18+
FUNCTION_GET_LATEST: 'git -c "versionsort.suffix=-" ls-remote --exit-code --refs --sort="version:refname" --tags ${GIT_ADDRESS} "*.*.*" | cut --delimiter="/" --fields=3 | grep -v -e pr | tail --lines=1'
19+
20+
jobs:
21+
build-ubuntu-ogre-src:
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-20.04, ubuntu-latest]
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Print system information
33+
run: lscpu
34+
35+
- name: Print OS information
36+
run: lsb_release -a
37+
38+
- name: Install dependencies for ubuntu 20.04
39+
if: matrix.os == 'ubuntu-20.04'
40+
run: |
41+
sudo apt-get update && sudo apt-get install -y libdc1394-22-dev
42+
43+
- name: Install common dependencies for ubuntu
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y libx11-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
47+
sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
48+
sudo apt-get install -y mesa-common-dev mesa-utils freeglut3-dev libflann-dev libboost-all-dev
49+
sudo apt-get install -y nlohmann-json3-dev
50+
51+
- name: Install dependencies for ubuntu-latest
52+
if: matrix.os == 'ubuntu-latest'
53+
run: |
54+
sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libeigen3-dev
55+
sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
56+
57+
- name: Install Ogre dependencies
58+
run: |
59+
sudo apt-get update && sudo apt-get install -y libgles2-mesa-dev libvulkan-dev glslang-dev libxrandr-dev libxaw7-dev libx11-dev libzzip-dev libsdl2-dev
60+
61+
- name: Build Ogre from source
62+
run: |
63+
pwd
64+
GIT_ADDRESS="https://github.com/OGRECave/ogre"
65+
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}`
66+
echo "Newest tag is ${LATEST_TAG}"
67+
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${HOME}/ogre
68+
cd ${HOME}/ogre
69+
mkdir build && cd build && mkdir install
70+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install
71+
make -j$(nproc) install
72+
echo "OGRE_DIR=$(pwd)/install" >> $GITHUB_ENV
73+
echo $OGRE_DIR
74+
75+
- name: Clone visp-images
76+
env:
77+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
78+
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
79+
run: |
80+
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
81+
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV
82+
echo ${VISP_INPUT_IMAGE_PATH}
83+
84+
- name: Configure CMake
85+
run: |
86+
pwd
87+
mkdir build && cd build && mkdir install
88+
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install
89+
cat ViSP-third-party.txt
90+
91+
- name: Build visp-config script
92+
working-directory: build
93+
run: |
94+
make -j$(nproc) developer_scripts
95+
./bin/visp-config --cflags
96+
./bin/visp-config --libs
97+
98+
- name: Build and install ViSP
99+
working-directory: build
100+
run: |
101+
make -j$(nproc) install
102+
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV
103+
echo $VISP_DIR
104+
105+
- name: Run unit tests
106+
working-directory: build
107+
run: ctest -j$(nproc) --output-on-failure
108+
109+
- name: Clone visp_started
110+
run: |
111+
git clone --depth 1 https://github.com/lagadic/visp_started ${HOME}/visp_started
112+
113+
- name: Build visp_started with ViSP as 3rdparty
114+
run: |
115+
cd ${HOME}/visp_started
116+
mkdir visp_started-build
117+
cd visp_started-build
118+
cmake ..
119+
make -j$(nproc)

CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ set(VISP_SOVERSION "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}")
142142
# Package revision number
143143
set(VISP_REVISION "1")
144144

145+
# Try to locate visp-images and, if it exists, its version
146+
vp_find_dataset(VISP_DATASET_FOUND VISP_DATASET_LOCATION
147+
VISP_DATASET_VERSION
148+
VISP_DATASET_VERSION_MAJOR
149+
VISP_DATASET_VERSION_MINOR
150+
VISP_DATASET_VERSION_PATCH)
151+
145152
#-----------------------------------------------------------------------------
146153
# TO BE CHECKED BEFORE NEXT RELEASE
147154
#
@@ -984,6 +991,7 @@ include(cmake/VISPExtraTargets.cmake)
984991
include(cmake/OgreTools.cmake)
985992
if(USE_OGRE)
986993
vp_set_ogre_media()
994+
set(VISP_HAVE_OGRE_VERSION "(${OGRE_VERSION_MAJOR}<<16 | ${OGRE_VERSION_MINOR}<<8 | ${OGRE_VERSION_PATCH})") # for vpConfig.h
987995
endif()
988996

989997
#----------------------------------------------------------------------
@@ -1436,10 +1444,6 @@ if(USE_JPEG)
14361444
endif()
14371445
endif()
14381446
endif()
1439-
if(USE_OIS)
1440-
vp_parse_header("${OIS_INCLUDE_DIR}/OISPrereqs.h" OIS_VERSION_LINES OIS_VERSION_MAJOR OIS_VERSION_MINOR OIS_VERSION_PATCH)
1441-
set(OIS_VERSION "${OIS_VERSION_MAJOR}.${OIS_VERSION_MINOR}.${OIS_VERSION_PATCH}")
1442-
endif()
14431447
if(USE_EIGEN3)
14441448
# Additionnal check to be sure that Eigen3 include dir os well detected
14451449
if(NOT EXISTS ${EIGEN3_INCLUDE_DIR})
@@ -1904,6 +1908,15 @@ endif()
19041908
if(USE_YARP)
19051909
status(" Yarp dir:" "${YARP_DIR}")
19061910
endif()
1911+
if(USE_OGRE)
1912+
if(NOT ${OGRE_DIR} STREQUAL "")
1913+
status(" Ogre dir:" "${OGRE_DIR}")
1914+
else()
1915+
status(" Ogre inc dir:" "${OGRE_INCLUDE_DIR}")
1916+
status(" Ogre Main lib:" "${OGRE_LIBRARY_REL}")
1917+
status(" Ogre plugin dir:" "${OGRE_PLUGIN_DIR_REL}")
1918+
endif()
1919+
endif()
19071920

19081921
# ========================== auxiliary ==========================
19091922
status("")

cmake/FindOIS.cmake

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#############################################################################
2+
#
3+
# ViSP, open source Visual Servoing Platform software.
4+
# Copyright (C) 2005 - 2025 by Inria. All rights reserved.
5+
#
6+
# This software is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
# See the file LICENSE.txt at the root directory of this source
11+
# distribution for additional information about the GNU GPL.
12+
#
13+
# For using ViSP with software that can not be combined with the GNU
14+
# GPL, please contact Inria about acquiring a ViSP Professional
15+
# Edition License.
16+
#
17+
# See https://visp.inria.fr for more information.
18+
#
19+
# This software was developed at:
20+
# Inria Rennes - Bretagne Atlantique
21+
# Campus Universitaire de Beaulieu
22+
# 35042 Rennes Cedex
23+
# France
24+
#
25+
# If you have questions regarding the use of this file, please contact
26+
27+
#
28+
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29+
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30+
#
31+
# Description:
32+
# Try to find OIS 3rd party used by vpAROgre class
33+
# Once run this will define:
34+
#
35+
# OIS_FOUND
36+
# OIS_INCLUDE_DIRS
37+
# OIS_LIBRARIES
38+
# OIS_VERSION
39+
#
40+
#############################################################################
41+
42+
find_path(OIS_INCLUDE_DIR
43+
NAMES ois/OIS.h
44+
PATHS
45+
$ENV{OIS_DIR}/include/ois
46+
${OIS_DIR}/include/ois
47+
/usr/include
48+
/usr/local/include
49+
)
50+
51+
find_library(OIS_LIBRARY
52+
NAMES OIS
53+
PATHS
54+
$ENV{OIS_DIR}/lib
55+
${OIS_DIR}/lib
56+
/usr/lib
57+
/usr/local/lib
58+
)
59+
60+
if(OIS_LIBRARY AND OIS_INCLUDE_DIR)
61+
set(OIS_INCLUDE_DIRS ${OIS_INCLUDE_DIR})
62+
set(OIS_LIBRARIES ${OIS_LIBRARY})
63+
set(OIS_FOUND TRUE)
64+
65+
get_filename_component(OIS_LIB_DIR ${OIS_LIBRARY} PATH)
66+
vp_get_version_from_pkg("OIS" "${OIS_LIB_DIR}/pkgconfig" OIS_VERSION)
67+
68+
if(NOT OIS_VERSION)
69+
vp_parse_header("${OIS_INCLUDE_DIR}/ois/OISPrereqs.h" OIS_VERSION_LINES OIS_VERSION_MAJOR OIS_VERSION_MINOR OIS_VERSION_PATCH)
70+
set(OIS_VERSION "${OIS_VERSION_MAJOR}.${OIS_VERSION_MINOR}.${OIS_VERSION_PATCH}")
71+
endif()
72+
else()
73+
set(OIS_FOUND FALSE)
74+
endif()
75+
76+
mark_as_advanced(
77+
OIS_INCLUDE_DIR
78+
OIS_LIBRARY
79+
)

cmake/FindVicon.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
# VICON_FOUND
3636
# VICON_INCLUDE_DIRS
3737
# VICON_LIBRARIES
38-
# VICON_VERSION
3938
#
4039
#############################################################################
4140

@@ -70,4 +69,4 @@ endif()
7069
mark_as_advanced(
7170
VICON_INCLUDE_DIR
7271
VICON_LIBRARY
73-
)
72+
)

0 commit comments

Comments
 (0)