diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-02-01 09:46:02 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-02-01 15:17:08 -0600 |
commit | 92bf4b9e64c32c284105b23ed01b8f24b3ac9ebc (patch) | |
tree | 634ee295758311bada82eee539d0033742549a49 | |
parent | a7ebdbd03819a4ef3506fde73a5b152e8b4cdbb7 (diff) | |
download | uhd-92bf4b9e64c32c284105b23ed01b8f24b3ac9ebc.tar.gz uhd-92bf4b9e64c32c284105b23ed01b8f24b3ac9ebc.tar.bz2 uhd-92bf4b9e64c32c284105b23ed01b8f24b3ac9ebc.zip |
ci: Enable building of init_usrp
This builds init_usrp against UHD during CI runs.
init_usrp is an example for how to write third-party apps using CMake that
link against UHD. This will test the UHDConfig.cmake (and related) CMake
files, as well as the example itself.
-rw-r--r-- | .ci/templates/steps-build-uhd-make.yml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.ci/templates/steps-build-uhd-make.yml b/.ci/templates/steps-build-uhd-make.yml index 2f478879d..b88581c54 100644 --- a/.ci/templates/steps-build-uhd-make.yml +++ b/.ci/templates/steps-build-uhd-make.yml @@ -92,3 +92,25 @@ steps: make install displayName: Install uhd to uhdBuildDir-installed condition: and(succeeded(), ${{ parameters.uhdGenerateTestBinaries }}) + +# init_usrp is an example for how to write third-party apps using CMake that +# link against UHD. This will test the UHDConfig.cmake (and related) CMake +# files, as well as the example. We can only do this if UHD was previously +# installed. +# We need to match the install prefix with the previous step in order to find +# UHDConfig.cmake. +- script: | + export EXAMPLE_BUILD_DIR="${{ parameters.uhdBuildDir }}/build_init_usrp" + export EXAMPLE_SRC_DIR="${{ parameters.uhdSrcDir }}/host/examples/init_usrp" + mkdir -p $EXAMPLE_BUILD_DIR + cd $EXAMPLE_BUILD_DIR + if [[ "${{ parameters.uhdCustomBoostPackage }}" = "True" ]]; then + export BOOST_CMAKE_DIR=$(dirname `find $(build_boost_step.CustomBoostPath)/stage/lib -name BoostConfig.cmake`) + export EXAMPLE_CMAKE_OPTIONS="-DBoost_INCLUDE_DIR=$(build_boost_step.CustomBoostPath) -DBoost_DIR=$BOOST_CMAKE_DIR -DBoost_LIBRARY_DIRS=$(build_boost_step.CustomBoostPath)/stage/lib $EXAMPLE_CMAKE_OPTIONS" + fi + cmake \ + -DCMAKE_INSTALL_PREFIX=${{ parameters.uhdBuildDir }}-installed \ + $EXAMPLE_CMAKE_OPTIONS $EXAMPLE_SRC_DIR && \ + make -j$(nproc) -k + displayName: Build init_usrp + condition: and(succeeded(), ${{ parameters.uhdGenerateTestBinaries }}) |