cmake: Remove some Boost dependencies

With the most recent changes, Boost.Thread and all Boost date/time
libraries are no longer required. This updates the CMake and Debian
files to reflect those changes.
This commit is contained in:
Martin Braun 2026-06-11 09:57:11 +02:00 committed by Martin Braun
parent fa0c49e074
commit 736fd1b85c
5 changed files with 12 additions and 14 deletions

View File

@ -316,14 +316,13 @@ message(STATUS "Configuring Boost C++ Libraries...")
# NO optional Boost components!
# ALL required Boost components!
set(UHD_BOOST_REQUIRED_COMPONENTS
chrono
date_time
filesystem
# Only used by utils and examples, not libuhd:
program_options
# Only used by nirio driver inside libuhd:
serialization
#system Boost.System is used, but explicitly listing it causes errors on some systems.
thread
#unit_test_framework Boost.Test is used, but listing it here causes problems when
#unit_test_framework Boost.Test is used, but listing it here causes problems when
# using static linking (the Windows default).
# Package detection for 'Boost::unit_test_framework' is handled
# separately in UHDBoost.cmake to work around this issue.

View File

@ -242,6 +242,15 @@ else()
message(STATUS "Looking for Boost version ${UHD_BOOST_MIN_VERSION} or greater - not found")
endif()
# Prefer the modern header-only Boost imported target when available, but keep
# the legacy alias for older FindBoost/CMake combinations.
if(TARGET Boost::headers AND NOT TARGET Boost::boost)
add_library(Boost::boost INTERFACE IMPORTED)
set_target_properties(Boost::boost PROPERTIES
INTERFACE_LINK_LIBRARIES Boost::headers
)
endif()
# unset some internal variables, if set
unset(Boost_LIBRARY_DIR)
unset(Boost_INCLUDE_DIR)

View File

@ -5,14 +5,12 @@ Maintainer: Ettus Research <uhd.maintainer@emerson.com>
Uploaders: Joerg Hofrichter <joerg.hofrichter@emerson.com>
Build-Depends: cmake,
debhelper (>= 12),
libboost-date-time-dev,
libboost-dev,
libboost-filesystem-dev,
libboost-program-options-dev,
libboost-serialization-dev,
libboost-system-dev,
libboost-test-dev,
libboost-thread-dev,
libncurses-dev,
libusb-1.0-0-dev [linux-any hurd-i386],
libusb2-dev [kfreebsd-any],

View File

@ -187,11 +187,8 @@ endif(DEFINED UHD_BOOST_REQUIRED_ADDITIONAL_WINDOWS_COMPONENTS)
target_link_libraries(uhd
PUBLIC
Boost::boost
Boost::chrono
Boost::date_time
Boost::filesystem
Boost::serialization
Boost::thread
${libuhd_boost_msvc_libs}
${libuhd_libs}
PRIVATE uhd_rc
@ -291,12 +288,9 @@ function(UHD_ADD_STATIC_LIB)
target_link_libraries(uhd_static
PUBLIC
Boost::boost
Boost::chrono
Boost::date_time
Boost::filesystem
Boost::serialization
Boost::system
Boost::thread
${libuhd_boost_msvc_libs}
)
target_include_directories(uhd_static

View File

@ -83,8 +83,6 @@ message(STATUS "")
message(STATUS "Configuring Boost C++ Libraries...")
set(BOOST_REQUIRED_COMPONENTS
system
thread
date_time
)
# Same as with Python version: MPM might work with other versions of Boost,
# but we don't make any guarantees.