Skip to content

Commit

Permalink
Check that all required CMake packages and targets are installed (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Sep 26, 2024
1 parent 48da4a1 commit 82b84f4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
if: contains(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.12.1

- name: Setup compilation env variables (not Windows)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
shell: bash -l {0}
run: |
echo "CMAKE_INSTALL_PREFIX=${CONDA_PREFIX}" >> $GITHUB_ENV
- name: Setup compilation env variables (Windows)
if: contains(matrix.os, 'windows')
shell: bash -l {0}
Expand All @@ -38,14 +44,15 @@ jobs:
compiler_path=${bash_vc_install}bin/Hostx64/x64/cl.exe
echo "CC=${compiler_path}" >> $GITHUB_ENV
echo "CXX=${compiler_path}" >> $GITHUB_ENV
echo "CMAKE_INSTALL_PREFIX=${CONDA_PREFIX}\Library" >> $GITHUB_ENV
- name: Configure
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DBUILD_TESTING:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DHDE_COMPILE_PYTHON_BINDINGS:BOOL=ON -DHUMANSTATEPROVIDER_ENABLE_VISUALIZER:BOOL=ON \
-DHUMANSTATEPROVIDER_ENABLE_LOGGER:BOOL=ON -DHDE_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON ..
Expand All @@ -70,6 +77,11 @@ jobs:
- name: Check install
shell: bash -l {0}
run: |
cd build
# Test CMake packages
cmake-package-check IWear --targets IWear::IWear
cmake-package-check WearableData --targets WearableData::WearableData
cmake-package-check WearableActuators --targets WearableActuators::WearableActuators
cmake-package-check HumanDynamicsEstimation --targets HumanDynamicsEstimation::HumanStateMsg
# Test python packages
python -c "import wearables"
python -c "import hde"
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.5)
project(HumanDynamicsEstimation
LANGUAGES CXX
VERSION 4.0.1)
VERSION 4.0.2)

# =====================
# PROJECT CONFIGURATION
Expand Down Expand Up @@ -141,7 +141,8 @@ install_basic_package_files(${PROJECT_NAME}
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion
VARS_PREFIX ${PROJECT_NAME}
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
NO_CHECK_REQUIRED_COMPONENTS_MACRO
DEPENDENCIES YARP)

# Add the uninstall target
include(AddUninstallTarget)
4 changes: 3 additions & 1 deletion ci_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ dependencies:
- make
- ninja
- pkg-config
- python
- pybind11
- yarp
- icub-main
- idyntree
- libmatio-cpp
- robometry
- librobometry
- osqp-eigen
- cmake-package-check
3 changes: 2 additions & 1 deletion interfaces/IWear/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ install_basic_package_files(IWear
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
EXPORT IWear
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
NO_CHECK_REQUIRED_COMPONENTS_MACRO
DEPENDENCIES YARP)
6 changes: 4 additions & 2 deletions msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ install_basic_package_files(WearableData
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
EXPORT WearableData
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
NO_CHECK_REQUIRED_COMPONENTS_MACRO
DEPENDENCIES YARP)

install(FILES ${WEARABLEDATA_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thrift)
Expand Down Expand Up @@ -97,7 +98,8 @@ install_basic_package_files(WearableActuators
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
EXPORT WearableActuators
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
NO_CHECK_REQUIRED_COMPONENTS_MACRO
DEPENDENCIES YARP)

install(FILES ${WEARABLEACTUATORS_FILES}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/thrift)
Expand Down

0 comments on commit 82b84f4

Please sign in to comment.