aboutsummaryrefslogtreecommitdiffstats
path: root/host
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
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')
-rw-r--r--host/CMakeLists.txt26
-rw-r--r--host/cmake/Modules/CMakeRC.cmake2
-rw-r--r--host/cmake/Modules/CodeCoverage.cmake10
-rw-r--r--host/cmake/Modules/UHDPackage.cmake24
-rw-r--r--host/cmake/Modules/UHDUnitTest.cmake18
-rw-r--r--host/cmake/Modules/UHDVersion.cmake10
-rw-r--r--host/docs/CMakeLists.txt16
-rw-r--r--host/docs/Doxyfile.in14
-rw-r--r--host/examples/rfnoc-example/CMakeLists.txt12
-rw-r--r--host/examples/rfnoc-example/apps/CMakeLists.txt2
-rw-r--r--host/examples/rfnoc-example/lib/CMakeLists.txt8
-rw-r--r--host/lib/CMakeLists.txt4
-rw-r--r--host/lib/cal/CMakeLists.txt2
-rw-r--r--host/lib/transport/nirio/lvbitx/CMakeLists.txt2
-rw-r--r--host/python/CMakeLists.txt14
-rw-r--r--host/tests/CMakeLists.txt140
-rw-r--r--host/tests/common/CMakeLists.txt2
-rw-r--r--host/tests/devtest/CMakeLists.txt2
18 files changed, 154 insertions, 154 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 3d60fa833..b741881d0 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -18,7 +18,7 @@ project(UHD CXX C)
enable_testing()
#make sure our local CMake Modules path comes first
-list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+list(INSERT CMAKE_MODULE_PATH 0 ${UHD_SOURCE_DIR}/cmake/Modules)
########################################################################
# UHD Dependency Minimum Versions
@@ -171,8 +171,8 @@ endif(DEFINED UHD_IMAGES_DIR_WINREG_KEY)
########################################################################
# Local Include Dir
########################################################################
-include_directories(${CMAKE_BINARY_DIR}/include)
-include_directories(${CMAKE_SOURCE_DIR}/include)
+include_directories(${UHD_BINARY_DIR}/include)
+include_directories(${UHD_SOURCE_DIR}/include)
########################################################################
# Static Lib Configuration
@@ -250,7 +250,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
endif()
if(MSVC)
- include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc)
+ include_directories(${UHD_SOURCE_DIR}/cmake/msvc)
add_definitions( #stop all kinds of compatibility warnings
-DWIN32_LEAN_AND_MEAN
-DVC_EXTRALEAN
@@ -396,7 +396,7 @@ endif(ENABLE_QEMU_UNITTESTS)
# Create Uninstall Target
########################################################################
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
+ ${UHD_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
@@ -509,20 +509,20 @@ endif(ENABLE_USB)
set(UHD_RFNOC_FOUND "TRUE")
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/Modules/UHDConfigVersion.cmake.in
- ${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
+ ${UHD_SOURCE_DIR}/cmake/Modules/UHDConfigVersion.cmake.in
+ ${UHD_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
@ONLY
)
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/Modules/UHDConfig.cmake.in
- ${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
+ ${UHD_SOURCE_DIR}/cmake/Modules/UHDConfig.cmake.in
+ ${UHD_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
@ONLY
)
set(uhd_cmake_scripts
- ${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
- ${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
- ${CMAKE_SOURCE_DIR}/cmake/Modules/UHDBoost.cmake
+ ${UHD_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
+ ${UHD_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
+ ${UHD_SOURCE_DIR}/cmake/Modules/UHDBoost.cmake
)
UHD_INSTALL(
@@ -536,7 +536,7 @@ UHD_INSTALL(
########################################################################
if(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}")
message(STATUS "Reading images from directory `${UHD_IMAGES_SRC_DIR}'")
- file(GLOB_RECURSE _image_files RELATIVE "${CMAKE_SOURCE_DIR}" "${UHD_IMAGES_SRC_DIR}/*")
+ file(GLOB_RECURSE _image_files RELATIVE "${UHD_SOURCE_DIR}" "${UHD_IMAGES_SRC_DIR}/*")
message(STATUS "These images files will be installed/packaged:")
foreach(_img ${_image_files})
message(STATUS " ${_img}")
diff --git a/host/cmake/Modules/CMakeRC.cmake b/host/cmake/Modules/CMakeRC.cmake
index 81a447c8e..ce6d8fbd2 100644
--- a/host/cmake/Modules/CMakeRC.cmake
+++ b/host/cmake/Modules/CMakeRC.cmake
@@ -85,7 +85,7 @@ function(_cmrc_normalize_path var)
set("${var}" "${path}" PARENT_SCOPE)
endfunction()
-get_filename_component(_inc_dir "${CMAKE_BINARY_DIR}/_cmrc/include" ABSOLUTE)
+get_filename_component(_inc_dir "${UHD_BINARY_DIR}/_cmrc/include" ABSOLUTE)
set(CMRC_INCLUDE_DIR "${_inc_dir}" CACHE INTERNAL "Directory for CMakeRC include files")
# Let's generate the primary include file
file(MAKE_DIRECTORY "${CMRC_INCLUDE_DIR}/cmrc")
diff --git a/host/cmake/Modules/CodeCoverage.cmake b/host/cmake/Modules/CodeCoverage.cmake
index e19c6399d..449b317af 100644
--- a/host/cmake/Modules/CodeCoverage.cmake
+++ b/host/cmake/Modules/CodeCoverage.cmake
@@ -71,7 +71,7 @@
find_program( GCOV_PATH gcov )
find_program( LCOV_PATH lcov )
find_program( GENHTML_PATH genhtml )
-find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+find_program( GCOVR_PATH gcovr PATHS ${UHD_SOURCE_DIR}/tests)
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
@@ -130,7 +130,7 @@ function(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
message(FATAL_ERROR "genhtml not found! Aborting...")
endif() # NOT GENHTML_PATH
- set(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
+ set(coverage_info "${UHD_BINARY_DIR}/${_outputname}.info")
set(coverage_cleaned "${coverage_info}.cleaned")
separate_arguments(test_command UNIX_COMMAND "${_testrunner}")
@@ -150,7 +150,7 @@ function(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
COMMAND ${GENHTML_PATH} -o ${_outputname} ${coverage_cleaned}
COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned}
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ WORKING_DIRECTORY ${UHD_BINARY_DIR}
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
)
@@ -183,8 +183,8 @@ function(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname
${_testrunner} ${ARGV3}
# Running gcovr
- COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ COMMAND ${GCOVR_PATH} -x -r ${UHD_SOURCE_DIR} -e '${UHD_SOURCE_DIR}/tests/' -o ${_outputname}.xml
+ WORKING_DIRECTORY ${UHD_BINARY_DIR}
COMMENT "Running gcovr to produce Cobertura code coverage report."
)
diff --git a/host/cmake/Modules/UHDPackage.cmake b/host/cmake/Modules/UHDPackage.cmake
index 4d507493b..2ccbed6e5 100644
--- a/host/cmake/Modules/UHDPackage.cmake
+++ b/host/cmake/Modules/UHDPackage.cmake
@@ -110,8 +110,8 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ettus Research - USRP Hardware Driver")
set(CPACK_PACKAGE_VENDOR "Ettus Research (National Instruments)")
set(CPACK_PACKAGE_CONTACT "Ettus Research <support@ettus.com>")
set(CPACK_PACKAGE_VERSION "${UHD_VERSION}")
-set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.md)
-set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
+set(CPACK_RESOURCE_FILE_WELCOME ${UHD_SOURCE_DIR}/README.md)
+set(CPACK_RESOURCE_FILE_LICENSE ${UHD_SOURCE_DIR}/LICENSE)
########################################################################
# Setup CPack Source
@@ -165,16 +165,16 @@ set(CPACK_COMPONENTS_ALL libraries pythonapi headers utilities examples manual d
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-all-dev, python3-requests")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python3, python3-tk")
foreach(filename preinst postinst prerm postrm)
- list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_BINARY_DIR}/debian/${filename})
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian)
+ list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${UHD_BINARY_DIR}/debian/${filename})
+ file(MAKE_DIRECTORY ${UHD_BINARY_DIR}/debian)
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/debian/${filename}.in
- ${CMAKE_BINARY_DIR}/debian/${filename}
+ ${UHD_SOURCE_DIR}/cmake/debian/${filename}.in
+ ${UHD_BINARY_DIR}/debian/${filename}
@ONLY)
endforeach(filename)
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/debian/watch
- ${CMAKE_BINARY_DIR}/debian/watch
+ ${UHD_SOURCE_DIR}/cmake/debian/watch
+ ${UHD_BINARY_DIR}/debian/watch
@ONLY)
########################################################################
@@ -185,11 +185,11 @@ set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel, python3-requests")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/man;/usr/share/man/man1;/usr/lib64/pkgconfig;/usr/lib64/cmake;/usr/lib64/python2.7;/usr/lib64/python2.7/site-packages")
foreach(filename post_install post_uninstall pre_install pre_uninstall)
string(TOUPPER ${filename} filename_upper)
- list(APPEND CPACK_RPM_${filename_upper}_SCRIPT_FILE ${CMAKE_BINARY_DIR}/redhat/${filename})
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/redhat)
+ list(APPEND CPACK_RPM_${filename_upper}_SCRIPT_FILE ${UHD_BINARY_DIR}/redhat/${filename})
+ file(MAKE_DIRECTORY ${UHD_BINARY_DIR}/redhat)
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/redhat/${filename}.in
- ${CMAKE_BINARY_DIR}/redhat/${filename}
+ ${UHD_SOURCE_DIR}/cmake/redhat/${filename}.in
+ ${UHD_BINARY_DIR}/redhat/${filename}
@ONLY)
endforeach(filename)
diff --git a/host/cmake/Modules/UHDUnitTest.cmake b/host/cmake/Modules/UHDUnitTest.cmake
index 4e6651fd9..d8933dd0e 100644
--- a/host/cmake/Modules/UHDUnitTest.cmake
+++ b/host/cmake/Modules/UHDUnitTest.cmake
@@ -20,13 +20,13 @@ function(UHD_ADD_TEST test_name)
#directory itself.
if(WIN32)
set(UHD_TEST_LIBRARY_DIRS
- "${CMAKE_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
+ "${UHD_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}"
"${Boost_LIBRARY_DIRS}"
)
else()
set(UHD_TEST_LIBRARY_DIRS
- "${CMAKE_BINARY_DIR}/lib"
+ "${UHD_BINARY_DIR}/lib"
"${CMAKE_CURRENT_BINARY_DIR}"
)
if(NOT APPLE)
@@ -56,7 +56,7 @@ function(UHD_ADD_TEST test_name)
#replace list separator with the path separator
string(REPLACE ";" ":" libpath "${libpath}")
- list(APPEND environs "PATH=\"${binpath}\"" "${LD_PATH_VAR}=\"${libpath}\"" "UHD_RFNOC_DIR=\"${CMAKE_SOURCE_DIR}/include/uhd/rfnoc\"")
+ list(APPEND environs "PATH=\"${binpath}\"" "${LD_PATH_VAR}=\"${libpath}\"" "UHD_RFNOC_DIR=\"${UHD_SOURCE_DIR}/include/uhd/rfnoc\"")
#generate a bat file that sets the environment and runs the test
if (CMAKE_CROSSCOMPILING)
@@ -88,7 +88,7 @@ function(UHD_ADD_TEST test_name)
#replace list separator with the path separator (escaped)
string(REPLACE ";" "\\;" libpath "${libpath}")
- list(APPEND environs "PATH=${libpath}" "UHD_RFNOC_DIR=${CMAKE_SOURCE_DIR}/include/uhd/rfnoc")
+ list(APPEND environs "PATH=${libpath}" "UHD_RFNOC_DIR=${UHD_SOURCE_DIR}/include/uhd/rfnoc")
#generate a bat file that sets the environment and runs the test
set(bat_file ${CMAKE_CURRENT_BINARY_DIR}/${test_name}_test.bat)
@@ -120,25 +120,25 @@ function(UHD_ADD_PYTEST test_name)
-m unittest discover
-s ${CMAKE_CURRENT_SOURCE_DIR}
-p "${test_name}.*"
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/python"
+ WORKING_DIRECTORY "${UHD_BINARY_DIR}/python"
)
else()
add_test(NAME ${test_name}
COMMAND ${RUNTIME_PYTHON_EXECUTABLE} -m unittest discover
-s ${CMAKE_CURRENT_SOURCE_DIR}
-p "${test_name}.*"
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/python"
+ WORKING_DIRECTORY "${UHD_BINARY_DIR}/python"
)
endif(ENABLE_QEMU_UNITTESTS)
- # Include ${CMAKE_BINARY_DIR}/utils/ for testing the python utils
+ # Include ${UHD_BINARY_DIR}/utils/ for testing the python utils
if(APPLE)
set_tests_properties(${test_name} PROPERTIES
ENVIRONMENT
- "DYLD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib/;PYTHONPATH=${UHD_BINARY_DIR}/python:${CMAKE_SOURCE_DIR}/tests/common:${CMAKE_BINARY_DIR}/utils/")
+ "DYLD_LIBRARY_PATH=${UHD_BINARY_DIR}/lib/;PYTHONPATH=${UHD_BINARY_DIR}/python:${UHD_SOURCE_DIR}/tests/common:${UHD_BINARY_DIR}/utils/")
else()
set_tests_properties(${test_name} PROPERTIES
ENVIRONMENT
- "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib/;PYTHONPATH=${UHD_BINARY_DIR}/python:${CMAKE_SOURCE_DIR}/tests/common:${CMAKE_BINARY_DIR}/utils/"
+ "LD_LIBRARY_PATH=${UHD_BINARY_DIR}/lib/;PYTHONPATH=${UHD_BINARY_DIR}/python:${UHD_SOURCE_DIR}/tests/common:${UHD_BINARY_DIR}/utils/"
)
endif()
endfunction(UHD_ADD_PYTEST)
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index 3a39a40cf..eff705571 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -38,7 +38,7 @@ endif(NOT DEFINED UHD_VERSION_DEVEL)
set(UHD_GIT_BRANCH "")
if(GIT_FOUND)
execute_process(
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${UHD_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE _git_branch OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _git_branch_result
@@ -77,7 +77,7 @@ endif(DEFINED UHD_GIT_BRANCH_OVERRIDE)
#grab the git ref id for the current head
execute_process(
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${UHD_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
OUTPUT_VARIABLE _git_describe OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _git_describe_result
@@ -87,7 +87,7 @@ execute_process(
if(_git_describe_result EQUAL 0)
if(NOT UHD_GIT_COUNT)
execute_process(
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${UHD_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "
try:
print('${_git_describe}'.split('-')[-2])
@@ -99,7 +99,7 @@ except IndexError:
endif()
if(NOT UHD_GIT_HASH)
execute_process(
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${UHD_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "
try:
print('${_git_describe}'.split('-')[-1])
@@ -125,7 +125,7 @@ if(UHD_RELEASE_MODE)
#Ignore UHD_GIT_COUNT in UHD_VERSION if the string 'release' is in UHD_RELEASE_MODE
execute_process(
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${UHD_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "print ('release' in '${UHD_RELEASE_MODE}') or ('rc' in '${UHD_RELEASE_MODE}')"
OUTPUT_VARIABLE TRIM_UHD_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
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
diff --git a/host/examples/rfnoc-example/CMakeLists.txt b/host/examples/rfnoc-example/CMakeLists.txt
index 738b5ae8e..4bd9db678 100644
--- a/host/examples/rfnoc-example/CMakeLists.txt
+++ b/host/examples/rfnoc-example/CMakeLists.txt
@@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.8)
project(rfnoc-example CXX C)
#make sure our local CMake Modules path comes first
-#list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+#list(INSERT CMAKE_MODULE_PATH 0 ${UHD_SOURCE_DIR}/cmake/Modules)
#install to PyBOMBS target prefix if defined
#if(DEFINED ENV{PYBOMBS_PREFIX})
@@ -37,8 +37,8 @@ find_package(UnixCommands)
if(BASH)
message(STATUS "Found bash interpreter: ${BASH}")
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/Modules/run_testbench.sh.in
- ${CMAKE_BINARY_DIR}/cmake/Modules/run_testbench.sh
+ ${UHD_SOURCE_DIR}/cmake/Modules/run_testbench.sh.in
+ ${UHD_BINARY_DIR}/cmake/Modules/run_testbench.sh
@ONLY
)
else()
@@ -98,7 +98,7 @@ macro(RFNOC_ADD_TB_DIR)
set(_target_name "${_tb_dir}_tb")
message(STATUS "Adding testbench target: ${_target_name}")
add_custom_target(${_target_name}
- COMMAND ${CMAKE_BINARY_DIR}/cmake/Modules/run_testbench.sh ${UHD_FPGA_DIR} ${UHD_FPGA_DEFAULT_DEVICE} ${CMAKE_CURRENT_SOURCE_DIR} xsim
+ COMMAND ${UHD_BINARY_DIR}/cmake/Modules/run_testbench.sh ${UHD_FPGA_DIR} ${UHD_FPGA_DEFAULT_DEVICE} ${CMAKE_CURRENT_SOURCE_DIR} xsim
)
add_dependencies(testbenches ${_target_name})
endif()
@@ -138,7 +138,7 @@ macro(RFNOC_REGISTER_IMAGE_CORE)
if (_rfnoc_image_builder_exe)
message(STATUS "Adding image core target: ${_target_name}")
add_custom_target(${_target_name}
- COMMAND ${_rfnoc_image_builder_exe} -F ${UHD_FPGA_DIR} -y ${CMAKE_CURRENT_SOURCE_DIR}/${_rfnoc_image_core_SRC} -I ${CMAKE_SOURCE_DIR}
+ COMMAND ${_rfnoc_image_builder_exe} -F ${UHD_FPGA_DIR} -y ${CMAKE_CURRENT_SOURCE_DIR}/${_rfnoc_image_core_SRC} -I ${UHD_SOURCE_DIR}
)
endif()
endmacro()
@@ -147,7 +147,7 @@ endmacro()
# Create uninstall target
########################################################################
configure_file(
- ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
+ ${UHD_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
add_custom_target(uninstall
diff --git a/host/examples/rfnoc-example/apps/CMakeLists.txt b/host/examples/rfnoc-example/apps/CMakeLists.txt
index bca9336ce..ea9dafd71 100644
--- a/host/examples/rfnoc-example/apps/CMakeLists.txt
+++ b/host/examples/rfnoc-example/apps/CMakeLists.txt
@@ -20,7 +20,7 @@ endif(MSVC)
find_package(Boost 1.65 REQUIRED ${BOOST_REQUIRED_COMPONENTS})
include_directories(
- ${CMAKE_SOURCE_DIR}/include
+ ${UHD_SOURCE_DIR}/include
)
add_executable(init_gain_block
diff --git a/host/examples/rfnoc-example/lib/CMakeLists.txt b/host/examples/rfnoc-example/lib/CMakeLists.txt
index 45b5c9b03..8b447723d 100644
--- a/host/examples/rfnoc-example/lib/CMakeLists.txt
+++ b/host/examples/rfnoc-example/lib/CMakeLists.txt
@@ -23,10 +23,10 @@ endif()
# Setup the include and linker paths
########################################################################
include_directories(
- ${CMAKE_SOURCE_DIR}/lib
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_BINARY_DIR}/lib
- ${CMAKE_BINARY_DIR}/include
+ ${UHD_SOURCE_DIR}/lib
+ ${UHD_SOURCE_DIR}/include
+ ${UHD_BINARY_DIR}/lib
+ ${UHD_BINARY_DIR}/include
${UHD_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index 910fe3c70..fd316221c 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -152,7 +152,7 @@ if(MSVC)
if(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
set(UHD_RC_IN "${CUSTOM_RC_FILE}")
else()
- set(UHD_RC_IN "${CMAKE_BINARY_DIR}/${CUSTOM_RC_FILE}")
+ set(UHD_RC_IN "${UHD_BINARY_DIR}/${CUSTOM_RC_FILE}")
endif(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
message(STATUS "")
message(STATUS "Using custom RC template: ${UHD_RC_IN}")
@@ -193,7 +193,7 @@ if(ENABLE_SIM)
# Get python include dirs
include_directories(${PYTHON_INCLUDE_DIRS})
set(PYBIND11_INCLUDE_DIR
- "${CMAKE_SOURCE_DIR}/lib/deps/pybind11/include"
+ "${UHD_SOURCE_DIR}/lib/deps/pybind11/include"
CACHE
STRING
"Location of PyBind11 includes"
diff --git a/host/lib/cal/CMakeLists.txt b/host/lib/cal/CMakeLists.txt
index da6bdf1a2..a39aac06c 100644
--- a/host/lib/cal/CMakeLists.txt
+++ b/host/lib/cal/CMakeLists.txt
@@ -7,7 +7,7 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-include_directories(${CMAKE_SOURCE_DIR}/lib/deps/flatbuffers/include)
+include_directories(${UHD_SOURCE_DIR}/lib/deps/flatbuffers/include)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/database.cpp
${CMAKE_CURRENT_SOURCE_DIR}/iq_cal.cpp
diff --git a/host/lib/transport/nirio/lvbitx/CMakeLists.txt b/host/lib/transport/nirio/lvbitx/CMakeLists.txt
index a68bef6fe..ea55409c9 100644
--- a/host/lib/transport/nirio/lvbitx/CMakeLists.txt
+++ b/host/lib/transport/nirio/lvbitx/CMakeLists.txt
@@ -12,7 +12,7 @@ macro(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile)
set( GEN_OPTIONS )
message( STATUS " Using ${lvbitx} for codegen" )
else( ${binfile} STREQUAL "OFF" )
- set( GEN_OPTIONS --merge-bin=${CMAKE_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${CMAKE_SOURCE_DIR}/../binaries )
+ set( GEN_OPTIONS --merge-bin=${UHD_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${UHD_SOURCE_DIR}/../binaries )
message( STATUS " Merging ${lvbitx} with ${binfile} for codegen" )
endif( ${binfile} STREQUAL "OFF" )
diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt
index 8f12e3f01..212bd9e46 100644
--- a/host/python/CMakeLists.txt
+++ b/host/python/CMakeLists.txt
@@ -17,7 +17,7 @@ PYTHON_CHECK_MODULE(
# Get include dirs
include_directories(${PYTHON_INCLUDE_DIRS})
set(PYBIND11_INCLUDE_DIR
- "${CMAKE_SOURCE_DIR}/lib/deps/pybind11/include"
+ "${UHD_SOURCE_DIR}/lib/deps/pybind11/include"
CACHE
STRING
"Location of PyBind11 includes"
@@ -31,9 +31,9 @@ execute_process(
# Build pyuhd library
add_library(pyuhd SHARED
pyuhd.cpp
- ${CMAKE_SOURCE_DIR}/lib/property_tree_python.cpp
- ${CMAKE_SOURCE_DIR}/lib/device_python.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/multi_usrp_python.cpp
+ ${UHD_SOURCE_DIR}/lib/property_tree_python.cpp
+ ${UHD_SOURCE_DIR}/lib/device_python.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/multi_usrp_python.cpp
)
# python expects extension modules with a particular suffix
if(WIN32)
@@ -56,7 +56,7 @@ else()
endif(WIN32)
target_include_directories(pyuhd PUBLIC
${PYTHON_NUMPY_INCLUDE_DIR}
- ${CMAKE_SOURCE_DIR}/lib
+ ${UHD_SOURCE_DIR}/lib
${PYBIND11_INCLUDE_DIR}
)
@@ -91,7 +91,7 @@ configure_file(${SETUP_PY_IN} ${SETUP_PY})
if(ENABLE_SIM)
set(MPM_DEVICE "sim")
- add_subdirectory(${CMAKE_SOURCE_DIR}/../mpm/python simulator)
+ add_subdirectory(${UHD_SOURCE_DIR}/../mpm/python simulator)
# simulator/usrp_mpm needs to be copied to usrp_mpm because setuptools only detects import packages in the working directory
add_custom_target(copy_mpm_packages ALL DEPENDS usrp_mpm)
add_custom_command(TARGET copy_mpm_packages
@@ -142,7 +142,7 @@ if(ENABLE_SIM)
${CMAKE_CURRENT_BINARY_DIR}/simulator/usrp_mpm/__init__.py
${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm)
# Move usrp_hwd.py into usrp_mpm so that it is included in the package
- configure_file(${CMAKE_SOURCE_DIR}/../mpm/python/usrp_hwd.py
+ configure_file(${UHD_SOURCE_DIR}/../mpm/python/usrp_hwd.py
${CMAKE_CURRENT_BINARY_DIR}/usrp_mpm/usrp_hwd.py COPYONLY)
set(PYUHD_FILES ${PYUHD_FILES} copy_mpm_packages)
endif(ENABLE_SIM)
diff --git a/host/tests/CMakeLists.txt b/host/tests/CMakeLists.txt
index 9b27e03c1..d3e44a518 100644
--- a/host/tests/CMakeLists.txt
+++ b/host/tests/CMakeLists.txt
@@ -89,8 +89,8 @@ if(ENABLE_C_API)
)
endif(ENABLE_C_API)
-include_directories("${CMAKE_SOURCE_DIR}/lib/include")
-include_directories("${CMAKE_BINARY_DIR}/lib/include")
+include_directories("${UHD_SOURCE_DIR}/lib/include")
+include_directories("${UHD_BINARY_DIR}/lib/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/common")
#for each source: build an executable, register it as a test
@@ -149,7 +149,7 @@ macro(UHD_ADD_RFNOC_BLOCK_TEST)
TARGET rfnoc_block_tests/${test_TARGET}
EXTRA_SOURCES
${test_EXTRA_SOURCES}
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/graph.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/graph.cpp
INCLUDE_DIRS
${test_INCLUDE_DIRS}
)
@@ -163,14 +163,14 @@ if(ENABLE_DPDK)
UHD_ADD_NONAPI_TEST(
TARGET "dpdk_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/utils/config_parser.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/paths.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/pathslib.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/prefs.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/adapter.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/config_parser.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/paths.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/pathslib.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/prefs.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/adapter.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
INCLUDE_DIRS
${DPDK_INCLUDE_DIRS}
EXTRA_LIBS ${DPDK_LIBRARIES}
@@ -179,23 +179,23 @@ if(ENABLE_DPDK)
UHD_ADD_NONAPI_TEST(
TARGET "dpdk_port_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/utils/config_parser.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/paths.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/pathslib.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/prefs.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/adapter.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/config_parser.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/paths.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/pathslib.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/prefs.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/adapter.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
INCLUDE_DIRS
${DPDK_INCLUDE_DIRS}
EXTRA_LIBS ${DPDK_LIBRARIES}
NOAUTORUN # Don't register for auto-run, it requires special config
)
set_source_files_properties(
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_common.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/uhd-dpdk/dpdk_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/udp_dpdk_link.cpp
PROPERTIES COMPILE_FLAGS "-march=native -D_GNU_SOURCE"
)
ENDIF(ENABLE_DPDK)
@@ -203,17 +203,17 @@ ENDIF(ENABLE_DPDK)
UHD_ADD_NONAPI_TEST(
TARGET "system_time_test.cpp"
EXTRA_SOURCES
- "${CMAKE_SOURCE_DIR}/lib/utils/system_time.cpp"
+ "${UHD_SOURCE_DIR}/lib/utils/system_time.cpp"
)
UHD_ADD_NONAPI_TEST(
TARGET "streamer_benchmark.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/chdr_packet_writer.cpp
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/chdr_ctrl_xport.cpp
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/chdr_rx_data_xport.cpp
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/chdr_tx_data_xport.cpp
- ${CMAKE_SOURCE_DIR}/lib/transport/inline_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/chdr_packet_writer.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/chdr_ctrl_xport.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/chdr_rx_data_xport.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/chdr_tx_data_xport.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/inline_io_service.cpp
NOAUTORUN # Don't register for auto-run
)
@@ -224,7 +224,7 @@ UHD_ADD_NONAPI_TEST(
UHD_ADD_NONAPI_TEST(
TARGET "config_parser_test.cpp"
- EXTRA_SOURCES ${CMAKE_SOURCE_DIR}/lib/utils/config_parser.cpp
+ EXTRA_SOURCES ${UHD_SOURCE_DIR}/lib/utils/config_parser.cpp
)
# Careful: This is to satisfy the out-of-library build of paths.cpp. This is
@@ -234,69 +234,69 @@ set(UHD_LIB_DIR "lib")
file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH)
string(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}")
set_source_files_properties(
- ${CMAKE_SOURCE_DIR}/lib/utils/paths.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/paths.cpp
PROPERTIES COMPILE_DEFINITIONS
"UHD_PKG_PATH=\"${UHD_PKG_PATH}\";UHD_LIB_DIR=\"${UHD_LIB_DIR}\""
)
UHD_ADD_NONAPI_TEST(
TARGET "paths_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/utils/pathslib.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/pathslib.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET rfnoc_propprop_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/graph.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/graph.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET rfnoc_detailgraph_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/graph.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/graph.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET actions_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/graph.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/graph.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET rfnoc_chdr_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/chdr_packet_writer.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/chdr_packet_writer.cpp
INCLUDE_DIRS
- ${CMAKE_BINARY_DIR}/lib/rfnoc/
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/
+ ${UHD_BINARY_DIR}/lib/rfnoc/
+ ${UHD_SOURCE_DIR}/lib/rfnoc/
)
UHD_ADD_NONAPI_TEST(
TARGET client_zero_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/client_zero.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/client_zero.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET zbx_cpld_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_lo_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_lo_ctrl.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
INCLUDE_DIRS
- ${CMAKE_BINARY_DIR}/lib/ic_reg_maps
+ ${UHD_BINARY_DIR}/lib/ic_reg_maps
)
UHD_ADD_NONAPI_TEST(
TARGET lmx2572_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
INCLUDE_DIRS
- ${CMAKE_BINARY_DIR}/lib/ic_reg_maps
+ ${UHD_BINARY_DIR}/lib/ic_reg_maps
)
set_source_files_properties(
- ${CMAKE_SOURCE_DIR}/lib/utils/system_time.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/system_time.cpp
PROPERTIES COMPILE_DEFINITIONS
"HAVE_MICROSEC_CLOCK"
)
@@ -368,72 +368,72 @@ UHD_ADD_RFNOC_BLOCK_TEST(
UHD_ADD_RFNOC_BLOCK_TEST(
TARGET x4xx_radio_block_test.cpp
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/common/pwr_cal_mgr.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/x400/x400_radio_control.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/x400/x400_rfdc_control.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/x400/adc_self_calibration.cpp
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/radio_control_impl.cpp
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/rf_control/gain_profile.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/mpmd/mpmd_mb_controller.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_dboard.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_dboard_init.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_lo_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp
- ${CMAKE_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_expert.cpp
- ${CMAKE_SOURCE_DIR}/lib/utils/compat_check.cpp
- ${CMAKE_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/common/lmx2572.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/common/pwr_cal_mgr.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/x400/x400_radio_control.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/x400/x400_rfdc_control.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/x400/adc_self_calibration.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/radio_control_impl.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/rf_control/gain_profile.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/mpmd/mpmd_mb_controller.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_dboard.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_dboard_init.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_lo_ctrl.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_cpld_ctrl.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/dboard/zbx/zbx_expert.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/compat_check.cpp
+ ${UHD_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
$<TARGET_OBJECTS:uhd_rpclib>
- INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/lib/deps/rpclib/include
- INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/lib/deps/flatbuffers/include
+ INCLUDE_DIRS ${UHD_SOURCE_DIR}/lib/deps/rpclib/include
+ INCLUDE_DIRS ${UHD_SOURCE_DIR}/lib/deps/flatbuffers/include
)
UHD_ADD_NONAPI_TEST(
TARGET "mb_controller_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
+ ${UHD_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "transport_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/transport/inline_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/inline_io_service.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "offload_io_srv_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/transport/offload_io_service.cpp
+ ${UHD_SOURCE_DIR}/lib/transport/offload_io_service.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "serial_number_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/utils/serial_number.cpp
+ ${UHD_SOURCE_DIR}/lib/utils/serial_number.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "pwr_cal_mgr_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/usrp/common/pwr_cal_mgr.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/common/pwr_cal_mgr.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "discoverable_feature_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
+ ${UHD_SOURCE_DIR}/lib/features/discoverable_feature_registry.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "rf_control_gain_profile_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/rfnoc/rf_control/gain_profile.cpp
+ ${UHD_SOURCE_DIR}/lib/rfnoc/rf_control/gain_profile.cpp
)
UHD_ADD_NONAPI_TEST(
TARGET "x400_rfdc_control_test.cpp"
EXTRA_SOURCES
- ${CMAKE_SOURCE_DIR}/lib/usrp/x400/x400_rfdc_control.cpp
+ ${UHD_SOURCE_DIR}/lib/usrp/x400/x400_rfdc_control.cpp
)
########################################################################
diff --git a/host/tests/common/CMakeLists.txt b/host/tests/common/CMakeLists.txt
index 7f31f3463..ac0e1b449 100644
--- a/host/tests/common/CMakeLists.txt
+++ b/host/tests/common/CMakeLists.txt
@@ -7,7 +7,7 @@
########################################################################
# Build uhd_test static lib
########################################################################
-include_directories("${CMAKE_SOURCE_DIR}/lib/include")
+include_directories("${UHD_SOURCE_DIR}/lib/include")
add_library(uhd_test
${CMAKE_CURRENT_SOURCE_DIR}/mock_zero_copy.cpp
)
diff --git a/host/tests/devtest/CMakeLists.txt b/host/tests/devtest/CMakeLists.txt
index 3f09620bf..5f70b2f06 100644
--- a/host/tests/devtest/CMakeLists.txt
+++ b/host/tests/devtest/CMakeLists.txt
@@ -28,7 +28,7 @@ macro(ADD_DEVTEST pattern filter devtype)
"--devtest-pattern" "${pattern}"
"--args" "$$EXTRA_DEV_ARGS,type=${filter}"
"--build-type" "${CMAKE_BUILD_TYPE}"
- "--build-dir" "${CMAKE_BINARY_DIR}"
+ "--build-dir" "${UHD_BINARY_DIR}"
"--python-interp" "${RUNTIME_PYTHON_EXECUTABLE}"
COMMENT "Running device test on all connected ${devtype} devices:"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"