Skip to content

Commit

Permalink
Imported upstream version '2.4.4' of 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
wxmerkt committed Jun 7, 2024
1 parent d8f71c2 commit f45cc76
Show file tree
Hide file tree
Showing 46 changed files with 1,154 additions and 331 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos-linux-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3) -DGENERATE_PYTHON_STUBS=ON -DHPP_FCL_HAS_QHULL=ON
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3) -DGENERATE_PYTHON_STUBS=ON -DHPP_FCL_HAS_QHULL=ON -DBUILD_DOCUMENTATION=ON -DINSTALL_DOCUMENTATION=ON
make -j2
make build_tests
export CTEST_OUTPUT_ON_FAILURE=1
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ ci:
autoupdate_branch: devel
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.14
hooks:
- id: ruff
args:
- --fix
- --exit-non-zero-on-fix
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.5
rev: v17.0.6
hooks:
- id: clang-format
args:
Expand All @@ -19,6 +19,6 @@ repos:
hooks:
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 23.12.1
hooks:
- id: black
279 changes: 152 additions & 127 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ endif()
SET_BOOST_DEFAULT_OPTIONS()
EXPORT_BOOST_DEFAULT_OPTIONS()
IF(WIN32)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS chrono thread date_time serialization)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS chrono thread date_time serialization filesystem)
ELSE(WIN32)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED chrono serialization)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED chrono serialization filesystem)
ENDIF(WIN32)
if(BUILD_PYTHON_INTERFACE)
find_package(Boost REQUIRED COMPONENTS system)
Expand Down
2 changes: 1 addition & 1 deletion cmake/.github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: [ubuntu-22.04]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Run project tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions cmake/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: check-useless-excludes
- id: check-hooks-apply
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.5
rev: v17.0.6
hooks:
- id: clang-format
args: [--style=Google]
Expand All @@ -25,15 +25,15 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.2.0
hooks:
- id: black
exclude: |
(?x)^(
.cmake-format.py
)$
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
exclude: |
Expand Down
125 changes: 125 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
cmake_minimum_required(VERSION 3.10)

set(PROJECT_NAME "jrl-cmakemodules")
set(PROJECT_DESCRIPTION "CMake utility toolbox")
set(PROJECT_URL "http://github.com/jrl-umi3218/${PROJECT_NAME}")

project(
${PROJECT_NAME}
DESCRIPTION ${PROJECT_DESCRIPTION}
LANGUAGES CXX
VERSION 0.0.0)

# Generate CMake exports
include(GNUInstallDirs)
include(package-config.cmake)
set(PROJECT_JRL_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR})
setup_project_package_finalize()

# Add a dummy library with a useful INTERFACE_INCLUDE_DIRECTORIES
add_library(${PROJECT_NAME} INTERFACE)
set(INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
target_include_directories(${PROJECT_NAME}
INTERFACE $<INSTALL_INTERFACE:${INSTALL_DIR}>)

# find . -maxdepth 1 -type d ! -path './.*' | sort
install(
DIRECTORY ./boost
./cython
./doxygen
./dynamic_graph
./find-external
./github
./gtest
./hpp
./image
./sphinx
./stubgen
./_unittests
DESTINATION ${INSTALL_DIR})

# find . -maxdepth 1 -type f ! -path './.*' | sort
install(
FILES ./announce-gen
./apple.cmake
./base.cmake
./boost.cmake
./catkin.cmake
./CMakeLists.txt
./cmake_reinstall.cmake.in
./cmake_uninstall.cmake.in
./compiler.cmake
./componentConfig.cmake.in
./Config.cmake.in
./config.h.cmake
./config.hh.cmake
./coverage.cmake
./cpack.cmake
./createshexe.cmake
./cxx11.cmake
./cxx-standard.cmake
./debian.cmake
./deprecated.hh.cmake
./distcheck.cmake
./dist.cmake
./doxygen.cmake
./eigen.cmake
./filefilter.txt
./fix-license.sh
./geometric-tools.cmake
./git-archive-all.py
./git-archive-all.sh
./gitlog-to-changelog
./GNUInstallDirs.cmake
./gtest.cmake
./header.cmake
./hpp.cmake
./ide.cmake
./idl.cmake
./idlrtc.cmake
./install-data.cmake
./julia.cmake
./kineo.cmake
./lapack.cmake
./LICENSE
./logging.cmake
./man.cmake
./memorycheck_unit_test.cmake.in
./metapodfromurdf.cmake
./modernize-links.cmake
./msvc-specific.cmake
./msvc.vcxproj.user.in
./openhrp.cmake
./openhrpcontroller.cmake
./openrtm.cmake
./oscheck.cmake
./package-config.cmake
./pkg-config.cmake
./pkg-config.pc.cmake
./portability.cmake
./post-project.cmake
./pthread.cmake
./pyproject.py
./python.cmake
./python-helpers.cmake
./qhull.cmake
./README.md
./release.cmake
./relpath.cmake
./ros.cmake
./sdformat.cmake
./setup.cfg
./shared-library.cmake
./sphinx.cmake
./stubs.cmake
./swig.cmake
./test.cmake
./uninstall.cmake
./version.cmake
./version-script.cmake
./version-script-test.lds
./warning.hh.cmake
./xacro.cmake
DESTINATION ${INSTALL_DIR})

install(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME})
25 changes: 25 additions & 0 deletions cmake/_unittests/catkin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.10)

set(PROJECT_NAME jrl-cmakemodules-catkin)
set(PROJECT_VERSION 0.0.0)
set(PROJECT_DESCRIPTION "JRL CMake module - catkin")
set(PROJECT_URL http://jrl-cmakemodules.readthedocs.io)

include(../../base.cmake)

project(${PROJECT_NAME} LANGUAGES CXX)

# This project test the correct behavior of #622
#
# * If .catkin is already here when the project is configured it is not removed
# * Otherwise it is assumed it is created by the project and removed with the
# uninstall target

option(FORCE_DOT_CATKIN_CREATION
"Force creation of .catkin file in install destination" OFF)

if(FORCE_DOT_CATKIN_CREATION)
install(
CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_INSTALL_PREFIX}/.catkin)"
)
endif()
2 changes: 1 addition & 1 deletion cmake/_unittests/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.10)

set(PROJECT_NAME jrl-cmakemodules-cpp)
set(PROJECT_VERSION 0.0.0)
Expand Down
2 changes: 1 addition & 1 deletion cmake/_unittests/dependency/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.10)

set(PROJECT_NAME jrl-cmakemodules-dependency)
set(PROJECT_VERSION 0.0.0)
Expand Down
2 changes: 1 addition & 1 deletion cmake/_unittests/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)

# These variables have to be defined before running SETUP_PROJECT
set(PROJECT_NAME jrl-cmakemodules-python)
Expand Down
32 changes: 31 additions & 1 deletion cmake/_unittests/run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash

unittests="python cpp dependency"
set -e
set -x

unittests="python cpp dependency catkin"

# Code for running a specific unit test
# For unit test foo, function `run_foo` is executed if defined.
Expand All @@ -23,6 +26,33 @@ function run_cpp()
run_default $here/cpp
}

function run_catkin()
{
$CMAKE_BIN ${cmake_options} -DFORCE_DOT_CATKIN_CREATION=ON "${here}/catkin"
make install
if [[ ! -f ${here}/install/.catkin ]]; then
echo ".catkin file should have been created"
exit 1
fi
make uninstall
if [[ -f ${here}/install/.catkin ]]; then
echo ".catkin file should have been removed"
exit 1
fi
cd ${here}/build/
rm -rf ${here}/build/catkin/
mkdir -p ${here}/build/catkin/
cd catkin
touch ${here}/install/.catkin
$CMAKE_BIN ${cmake_options} -DFORCE_DOT_CATKIN_CREATION=OFF "${here}/catkin"
make install
make uninstall
if [[ ! -f ${here}/install/.catkin ]]; then
echo ".catkin file should NOT have been removed"
exit 1
fi
}

# The code below run all the unit tests
here="`pwd`"
rm -rf build install
Expand Down
4 changes: 2 additions & 2 deletions cmake/cmake_reinstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
execute_process(COMMAND "@CMAKE_COMMAND@" --build "@PROJECT_BINARY_DIR@" --target uninstall --config $<CONFIGURATION>)
execute_process(COMMAND ${CMAKE_COMMAND} --build "@PROJECT_BINARY_DIR@" --target uninstall --config $<CONFIGURATION>)
endif()
execute_process(COMMAND "@CMAKE_COMMAND@" --build "@PROJECT_BINARY_DIR@" --target install --config $<CONFIGURATION>)
execute_process(COMMAND ${CMAKE_COMMAND} --build "@PROJECT_BINARY_DIR@" --target install --config $<CONFIGURATION>)
14 changes: 7 additions & 7 deletions cmake/cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

MESSAGE(STATUS "catkin path: @CMAKE_INSTALL_PREFIX@/.catkin")
IF(EXISTS "@CMAKE_INSTALL_PREFIX@/.catkin")
IF(EXISTS "@CMAKE_INSTALL_PREFIX@/.catkin" AND PACKAGE_CREATES_DOT_CATKIN)
MESSAGE(STATUS "Try to remove @CMAKE_INSTALL_PREFIX@/.catkin")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "@CMAKE_INSTALL_PREFIX@/.catkin"
COMMAND ${CMAKE_COMMAND} -E remove "@CMAKE_INSTALL_PREFIX@/.catkin"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_VARIABLE rm_err
)
ENDIF(EXISTS "@CMAKE_INSTALL_PREFIX@/.catkin")
ENDIF()

IF(EXISTS "@CMAKE_CURRRENT_BINARY_DIR@/install_manifest.txt")
return()
Expand All @@ -40,7 +40,7 @@ FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
)
Expand All @@ -54,7 +54,7 @@ FOREACH(file ${files})
IF(EXISTS "$ENV{DESTDIR}${pycfile}")
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${pycfile}\"")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${pycfile}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${pycfile}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
)
Expand All @@ -70,15 +70,15 @@ FOREACH(file ${files})
# If file is a broken symbolic link, EXISTS returns false.
# Workaround this bug by attempting to remove the file anyway.
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_QUIET
)
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)
EXECUTE_PROCESS(
COMMAND "@CMAKE_COMMAND@" -E remove "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"
COMMAND ${CMAKE_COMMAND} -E remove "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_QUIET
Expand Down
Loading

0 comments on commit f45cc76

Please sign in to comment.