aboutsummaryrefslogtreecommitdiffstats
path: root/host/docs
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-09-02 11:38:05 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-09-10 15:08:10 -0500
commit09d94529e5dbfa992cb6012cc0dc38d6f3e7d57d (patch)
treef632274ec4af60e1559a361bd2b607cc65e9d5f7 /host/docs
parente64d3e28316f642c1203722b6f5f2af710a7e281 (diff)
downloaduhd-09d94529e5dbfa992cb6012cc0dc38d6f3e7d57d.tar.gz
uhd-09d94529e5dbfa992cb6012cc0dc38d6f3e7d57d.tar.bz2
uhd-09d94529e5dbfa992cb6012cc0dc38d6f3e7d57d.zip
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.
Diffstat (limited to 'host/docs')
-rw-r--r--host/docs/CMakeLists.txt16
-rw-r--r--host/docs/Doxyfile.in14
2 files changed, 15 insertions, 15 deletions
diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt
index 37d67bb16..e9b35bdc2 100644
--- a/host/docs/CMakeLists.txt
+++ b/host/docs/CMakeLists.txt
@@ -22,16 +22,16 @@ set(ENABLE_MANUAL_OR_DOXYGEN false)
LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "DOXYGEN_FOUND" OFF OFF)
if(ENABLE_MANUAL)
- set(FPGA_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../fpga")
+ set(FPGA_SOURCE_DIR "${UHD_SOURCE_DIR}/../fpga")
set(ENABLE_MANUAL_OR_DOXYGEN true)
file(GLOB manual_sources "*.dox")
file(GLOB_RECURSE fpga_manual_sources "${FPGA_SOURCE_DIR}/docs/*.md")
list(APPEND manual_sources ${fpga_manual_sources})
set(DOXYGEN_DEPENDENCIES ${manual_sources})
- set(DOXYGEN_INPUT_DIRS "${CMAKE_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR} ${FPGA_SOURCE_DIR}/docs")
+ set(DOXYGEN_INPUT_DIRS "${UHD_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR} ${FPGA_SOURCE_DIR}/docs")
set(DOXYGEN_DEP_COMPONENT "manual")
set(DOXYGEN_FPGA_MANUAL_REFERENCE "\\subpage md_fpga \"Part III: FPGA Manual\"")
- set(DOXYGEN_STRIP_EXTRA "${CMAKE_SOURCE_DIR}/../fpga/docs")
+ set(DOXYGEN_STRIP_EXTRA "${UHD_SOURCE_DIR}/../fpga/docs")
set(DOXYGEN_EXCLUDE_DIRS "")
endif(ENABLE_MANUAL)
@@ -50,14 +50,14 @@ endif(LIBUHDDEV_PKG)
if(ENABLE_DOXYGEN)
set(ENABLE_MANUAL_OR_DOXYGEN true)
#make doxygen directory depend on the header files
- file(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
- file(GLOB_RECURSE h_files ${CMAKE_SOURCE_DIR}/include/*.h)
+ file(GLOB_RECURSE header_files ${UHD_SOURCE_DIR}/include/*.hpp)
+ file(GLOB_RECURSE h_files ${UHD_SOURCE_DIR}/include/*.h)
list(APPEND header_files ${h_files})
set(DOXYGEN_DEPENDENCIES ${DOXYGEN_DEPENDENCIES} ${header_files})
if(ENABLE_DOXYGEN_FULL)
- set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/python")
+ set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${UHD_SOURCE_DIR}/include ${UHD_SOURCE_DIR}/lib ${UHD_SOURCE_DIR}/python")
else(ENABLE_DOXYGEN_FULL)
- set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include")
+ set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${UHD_SOURCE_DIR}/include")
endif(ENABLE_DOXYGEN_FULL)
set(DOXYGEN_DEP_COMPONENT "doxygen")
@@ -90,7 +90,7 @@ if(ENABLE_MANUAL_OR_DOXYGEN)
@ONLY)
#make doxygen directory depend on the header files
- file(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
+ file(GLOB_RECURSE header_files ${UHD_SOURCE_DIR}/include/*.hpp)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DEPENDS ${DOXYGEN_DEPENDENCIES}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
diff --git a/host/docs/Doxyfile.in b/host/docs/Doxyfile.in
index 4f1d9f573..06719dc5e 100644
--- a/host/docs/Doxyfile.in
+++ b/host/docs/Doxyfile.in
@@ -51,7 +51,7 @@ PROJECT_BRIEF = "UHD and USRP Manual"
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
-PROJECT_LOGO = @CMAKE_SOURCE_DIR@/docs/Ettus_Logo.png
+PROJECT_LOGO = @UHD_SOURCE_DIR@/docs/Ettus_Logo.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@@ -165,7 +165,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ \
+STRIP_FROM_PATH = @UHD_SOURCE_DIR@ \
@DOXYGEN_STRIP_EXTRA@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
@@ -175,7 +175,7 @@ STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ \
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
-STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/include
+STRIP_FROM_INC_PATH = @UHD_SOURCE_DIR@/include
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
@@ -892,10 +892,10 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = @CMAKE_SOURCE_DIR@/include/uhd/transport/nirio \
- @CMAKE_SOURCE_DIR@/include/uhd/transport/nirio_zero_copy.hpp \
+EXCLUDE = @UHD_SOURCE_DIR@/include/uhd/transport/nirio \
+ @UHD_SOURCE_DIR@/include/uhd/transport/nirio_zero_copy.hpp \
@DOXYGEN_EXCLUDE_DIRS@ \
- @CMAKE_SOURCE_DIR@/lib/deps
+ @UHD_SOURCE_DIR@/lib/deps
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@@ -948,7 +948,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = @CMAKE_SOURCE_DIR@/docs/res
+IMAGE_PATH = @UHD_SOURCE_DIR@/docs/res
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program