From fa24330bf85b3a746e98b155a476f18bfcd75e01 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 19 Dec 2024 10:13:43 +0100 Subject: [PATCH] Fix calling ycm_ep_helper when YCM is consumed via find_package(YCM) and add test (#468) --- .github/workflows/conda-forge-ci.yml | 21 +++++++++++++++++++-- modules/CMakeLists.txt | 6 ++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-forge-ci.yml b/.github/workflows/conda-forge-ci.yml index 19e93b74..9b3487c2 100644 --- a/.github/workflows/conda-forge-ci.yml +++ b/.github/workflows/conda-forge-ci.yml @@ -62,7 +62,7 @@ jobs: mkdir -p build cd build cmake -GNinja -DBUILD_TESTING:BOOL=ON -DFRAMEWORK_COMPILE_IK:BOOL=OFF \ - -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. + -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. - name: Build [Linux&macOS] if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') @@ -84,7 +84,7 @@ jobs: run: | mkdir -p build cd build - cmake -GNinja -DBUILD_TESTING:BOOL=ON -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. + cmake -GNinja -DBUILD_TESTING:BOOL=ON -DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library .. - name: Build [Windows] if: contains(matrix.os, 'windows') @@ -99,3 +99,20 @@ jobs: run: | cd build ctest --output-on-failure -C ${{ matrix.build_type }} -E "Bootstrap" + + - name: Install + shell: bash -l {0} + run: | + cd build + cmake --install . + + - name: Integration test run a configure of the robotology-superbuild + shell: bash -l {0} + run: | + mkdir testint + cd testint + git clone https://github.com/robotology/robotology-superbuild/ + cd robotology-superbuild/ + git config --global user.name CI User + git config --global user.email ciuser@example.com + cmake -Bbuild -S. diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 046e556d..a382da83 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -16,6 +16,12 @@ set(YCM_MODULES AddInstallRPATHSupport.cmake _ycm_install(modules FILES ${YCM_MODULES} DESTINATION "${YCM_INSTALL_MODULE_DIR}/modules") +set(YCMEPHELPER_FILES YCMEPHelper/RepositoryInfo.txt.in + YCMEPHelper/gitsafeclone.txt.in) + +_ycm_install(modules FILES ${YCMEPHELPER_FILES} + DESTINATION "${YCM_INSTALL_MODULE_DIR}/modules/YCMEPHelper") + # Print a warning if we are overriding some module from CMake foreach(_module IN LISTS YCM_MODULES) if(EXISTS "${CMAKE_ROOT}/Modules/${_module}")