-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1538 from rolalaro/ogre-1_12
Compatibility with more recent versions of Ogre
- Loading branch information
Showing
28 changed files
with
1,328 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Ubuntu-ogre-apt | ||
|
||
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
schedule: | ||
- cron: '0 2 * * SUN' | ||
|
||
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-ubuntu-ogre-apt: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-latest] | ||
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++} ] | ||
standard: [ 11, 17 ] | ||
ogre: [ogre-1.9, ogre-1.12] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Print system information | ||
run: lscpu | ||
|
||
- name: Print OS information | ||
run: lsb_release -a | ||
|
||
- name: Print compiler information | ||
run: dpkg --list | grep compiler | ||
|
||
- name: Install ViSP dependencies | ||
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 | ||
|
||
- name: Install Ogre 1.9 | ||
if: matrix.ogre == 'ogre-1.9' && matrix.standard != '17' | ||
run: sudo apt-get update && sudo apt-get install -y libogre-1.9-dev | ||
|
||
- name: Install Ogre 1.12 | ||
if: matrix.ogre == 'ogre-1.12' | ||
run: sudo apt-get update && sudo apt-get install -y libogre-1.12-dev | ||
|
||
- name: Clone visp-images | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ | ||
run: | | ||
git clone --depth 1 /~https://github.com/lagadic/visp-images ${HOME}/visp-images | ||
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV | ||
echo ${VISP_INPUT_IMAGE_PATH} | ||
- name: Clone visp_sample | ||
run: | | ||
git clone --depth 1 /~https://github.com/lagadic/visp_sample ${HOME}/visp_sample | ||
- name: Configure CMake | ||
run: | | ||
mkdir build | ||
cd build | ||
CC=${{ matrix.compiler.CC }} | ||
CXX=${{ matrix.compiler.CXX }} | ||
CXX_STANDARD=${{ matrix.standard }} | ||
echo "CC: $CC" | ||
echo "CXX: $CXX" | ||
echo "Standard: $CXX_STANDARD" | ||
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 | ||
cat ViSP-third-party.txt | ||
- name: Compile | ||
working-directory: build | ||
run: | | ||
make -j$(nproc) install | ||
- name: Run unit tests | ||
working-directory: build | ||
run: ctest -j$(nproc) --output-on-failure | ||
|
||
- name: ViSP as 3rdparty with cmake | ||
run: | | ||
cd ${HOME}/visp_sample | ||
mkdir visp_sample-build | ||
cd visp_sample-build | ||
CC=${{ matrix.compiler.CC }} | ||
CXX=${{ matrix.compiler.CXX }} | ||
cmake .. -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DVISP_DIR=/tmp/usr/local/lib/cmake/visp -DCMAKE_VERBOSE_MAKEFILE=ON | ||
make -j$(nproc) | ||
- name: ViSP as 3rdparty with visp.pc and pkg-config | ||
run: | | ||
cd ${HOME}/visp_sample | ||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig | ||
CC=${{ matrix.compiler.CC }} | ||
CXX=${{ matrix.compiler.CXX }} | ||
pkg-config --cflags visp | ||
pkg-config --libs visp | ||
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc | ||
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp.pc clean | ||
- name: ViSP as 3rdparty with visp-config | ||
run: | | ||
cd ${HOME}/visp_sample | ||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig | ||
export VISP_INSTALL_PREFIX=/tmp/usr/local | ||
CC=${{ matrix.compiler.CC }} | ||
CXX=${{ matrix.compiler.CXX }} | ||
$VISP_INSTALL_PREFIX/bin/visp-config --cflags | ||
$VISP_INSTALL_PREFIX/bin/visp-config --libs | ||
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config | ||
make CXX=${{ matrix.compiler.CXX }} -j$(nproc) -f Makefile.visp-config clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: Ubuntu-ogre-src | ||
|
||
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
schedule: | ||
- cron: '0 2 * * SUN' | ||
|
||
# https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre#comment133398800_72408109 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# Function to get the most recent tag of a remote repository without having to clone it, excluding tag with 'pr' as in Pre Release | ||
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' | ||
|
||
jobs: | ||
build-ubuntu-ogre-src: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Print system information | ||
run: lscpu | ||
|
||
- name: Print OS information | ||
run: lsb_release -a | ||
|
||
- name: Install dependencies for ubuntu 20.04 | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y libdc1394-22-dev | ||
- name: Install common dependencies for ubuntu | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libx11-dev libv4l-dev gfortran liblapack-dev libeigen3-dev | ||
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 | ||
sudo apt-get install -y mesa-common-dev mesa-utils freeglut3-dev libflann-dev libboost-all-dev | ||
sudo apt-get install -y nlohmann-json3-dev | ||
- name: Install dependencies for ubuntu-latest | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libeigen3-dev | ||
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 | ||
- name: Install Ogre dependencies | ||
run: | | ||
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 | ||
- name: Build Ogre from source | ||
run: | | ||
pwd | ||
GIT_ADDRESS="/~https://github.com/OGRECave/ogre" | ||
LATEST_TAG=`eval ${FUNCTION_GET_LATEST}` | ||
echo "Newest tag is ${LATEST_TAG}" | ||
git clone --depth 1 --branch ${LATEST_TAG} ${GIT_ADDRESS} ${HOME}/ogre | ||
cd ${HOME}/ogre | ||
mkdir build && cd build && mkdir install | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install | ||
make -j$(nproc) install | ||
echo "OGRE_DIR=$(pwd)/install" >> $GITHUB_ENV | ||
echo $OGRE_DIR | ||
- name: Clone visp-images | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/ | ||
run: | | ||
git clone --depth 1 /~https://github.com/lagadic/visp-images ${HOME}/visp-images | ||
echo "VISP_INPUT_IMAGE_PATH=$HOME/visp-images" >> $GITHUB_ENV | ||
echo ${VISP_INPUT_IMAGE_PATH} | ||
- name: Configure CMake | ||
run: | | ||
pwd | ||
mkdir build && cd build && mkdir install | ||
cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/install | ||
cat ViSP-third-party.txt | ||
- name: Build visp-config script | ||
working-directory: build | ||
run: | | ||
make -j$(nproc) developer_scripts | ||
./bin/visp-config --cflags | ||
./bin/visp-config --libs | ||
- name: Build and install ViSP | ||
working-directory: build | ||
run: | | ||
make -j$(nproc) install | ||
echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV | ||
echo $VISP_DIR | ||
- name: Run unit tests | ||
working-directory: build | ||
run: ctest -j$(nproc) --output-on-failure | ||
|
||
- name: Clone visp_started | ||
run: | | ||
git clone --depth 1 /~https://github.com/lagadic/visp_started ${HOME}/visp_started | ||
- name: Build visp_started with ViSP as 3rdparty | ||
run: | | ||
cd ${HOME}/visp_started | ||
mkdir visp_started-build | ||
cd visp_started-build | ||
cmake .. | ||
make -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
############################################################################# | ||
# | ||
# ViSP, open source Visual Servoing Platform software. | ||
# Copyright (C) 2005 - 2025 by Inria. All rights reserved. | ||
# | ||
# This software is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# See the file LICENSE.txt at the root directory of this source | ||
# distribution for additional information about the GNU GPL. | ||
# | ||
# For using ViSP with software that can not be combined with the GNU | ||
# GPL, please contact Inria about acquiring a ViSP Professional | ||
# Edition License. | ||
# | ||
# See https://visp.inria.fr for more information. | ||
# | ||
# This software was developed at: | ||
# Inria Rennes - Bretagne Atlantique | ||
# Campus Universitaire de Beaulieu | ||
# 35042 Rennes Cedex | ||
# France | ||
# | ||
# If you have questions regarding the use of this file, please contact | ||
# Inria at visp@inria.fr | ||
# | ||
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# Description: | ||
# Try to find OIS 3rd party used by vpAROgre class | ||
# Once run this will define: | ||
# | ||
# OIS_FOUND | ||
# OIS_INCLUDE_DIRS | ||
# OIS_LIBRARIES | ||
# OIS_VERSION | ||
# | ||
############################################################################# | ||
|
||
find_path(OIS_INCLUDE_DIR | ||
NAMES ois/OIS.h | ||
PATHS | ||
$ENV{OIS_DIR}/include/ois | ||
${OIS_DIR}/include/ois | ||
/usr/include | ||
/usr/local/include | ||
) | ||
|
||
find_library(OIS_LIBRARY | ||
NAMES OIS | ||
PATHS | ||
$ENV{OIS_DIR}/lib | ||
${OIS_DIR}/lib | ||
/usr/lib | ||
/usr/local/lib | ||
) | ||
|
||
if(OIS_LIBRARY AND OIS_INCLUDE_DIR) | ||
set(OIS_INCLUDE_DIRS ${OIS_INCLUDE_DIR}) | ||
set(OIS_LIBRARIES ${OIS_LIBRARY}) | ||
set(OIS_FOUND TRUE) | ||
|
||
get_filename_component(OIS_LIB_DIR ${OIS_LIBRARY} PATH) | ||
vp_get_version_from_pkg("OIS" "${OIS_LIB_DIR}/pkgconfig" OIS_VERSION) | ||
|
||
if(NOT OIS_VERSION) | ||
vp_parse_header("${OIS_INCLUDE_DIR}/ois/OISPrereqs.h" OIS_VERSION_LINES OIS_VERSION_MAJOR OIS_VERSION_MINOR OIS_VERSION_PATCH) | ||
set(OIS_VERSION "${OIS_VERSION_MAJOR}.${OIS_VERSION_MINOR}.${OIS_VERSION_PATCH}") | ||
endif() | ||
else() | ||
set(OIS_FOUND FALSE) | ||
endif() | ||
|
||
mark_as_advanced( | ||
OIS_INCLUDE_DIR | ||
OIS_LIBRARY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.