From 09d94529e5dbfa992cb6012cc0dc38d6f3e7d57d Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 2 Sep 2021 11:38:05 +0200 Subject: 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. --- host/docs/Doxyfile.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'host/docs/Doxyfile.in') 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 -- cgit v1.2.3