aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2022-02-01 09:46:02 +0100
committerAaron Rossetto <aaron.rossetto@ni.com>2022-04-01 14:36:35 -0500
commita039bc20cc9069cbd5a5c5aa89d98ff94cb5c678 (patch)
treece6f3005117e1be3cb271180e3061ee299c31b1f
parentci: Make uhdSrcDir directly reference Build.SourcesDirectory (diff)
downloaduhd-a039bc20cc9069cbd5a5c5aa89d98ff94cb5c678.tar.xz
uhd-a039bc20cc9069cbd5a5c5aa89d98ff94cb5c678.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.yml22
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 }})