uhd/mpm/lib/CMakeLists.txt
Martin Braun 09d94529e5 cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIR
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html

Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.

This was changed using sed:

$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
    `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
    `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`

At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.

Shoutout to GitHub user marcobergamin for bringing this up.
2021-09-10 15:08:10 -05:00

31 lines
600 B
CMake

#
# Copyright 2017-2018 Ettus Research, a National Instruments Company
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
set(UHD_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../host)
add_subdirectory(dboards)
add_subdirectory(chips)
add_subdirectory(spi)
add_subdirectory(i2c)
add_subdirectory(types)
if(ENABLE_MYKONOS)
add_subdirectory(mykonos)
elseif(ENABLE_E320 OR ENABLE_E300)
add_subdirectory(catalina)
endif(ENABLE_MYKONOS)
if(ENABLE_X400)
add_subdirectory(rfdc)
endif(ENABLE_X400)
USRP_PERIPHS_ADD_OBJECT(periphs
exception.cpp
${UHD_SOURCE_DIR}/lib/exception.cpp
)
# vim: set sw=4 et: