summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib
diff options
context:
space:
mode:
authorRyan Volz <ryan.volz@gmail.com>2021-05-12 18:56:11 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-06-25 08:30:09 -0400
commitcaf0f1e28be1f62ff9fdd48f2333f6068ccfa74d (patch)
tree17a15ba0cae2bc8aff04c34b4e6f701cfb3f8632 /gnuradio-runtime/lib
parentac738e2a6db48f13929c780d89a87ba5e916e2d3 (diff)
cmake: Remove absolute paths and private links from exported targets.
This transitions to using Python::NumPy, pybind11::pybind11, and libunwind::libunwind targets for building with the include directories/libraries of NumPy, pybind11, and libunwind. The Python::NumPy target matches what is available with the FindPython module in CMake 3.14+ (and can be transitioned to such when the minimum CMake version is past that). These changes have the effect of cleaning up the include_directory paths added to the gnuradio-runtime target so that no absolute paths are used, which is helpful for relocatable installations (e.g. conda). Part of this change involves moving some link targets to PRIVATE since they are not actually part of the public interface. In the case of the python bindings, these are not exported and have no public interface for consumption by other C++ libraries, so the switch from PUBLIC to PRIVATE has no practical effect but could still help avoid future confusion. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
Diffstat (limited to 'gnuradio-runtime/lib')
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt8
1 files changed, 2 insertions, 6 deletions
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index 2e1ba2ea2d..9db44ff552 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -12,9 +12,6 @@ gr_check_hdr_n_def(sys/resource.h HAVE_SYS_RESOURCE_H)
# Look for libunwind
########################################################################
find_package(libunwind)
-if(libunwind_FOUND)
- add_definitions(-DHAVE_LIBUNWIND)
-endif(libunwind_FOUND)
########################################################################
# Handle the generated constants
@@ -131,7 +128,6 @@ target_link_libraries(gnuradio-runtime PUBLIC
Boost::thread
Log4Cpp::log4cpp
MPLib::mplib
- ${libunwind_LIBRARIES}
# INTERFACE/PRIVATE split so users of the library can choose how to link to Python
# (importantly, extension modules can avoid linking against Python and resolve
# their own Python symbols at runtime through the Python interpreter's linking)
@@ -139,6 +135,8 @@ target_link_libraries(gnuradio-runtime PUBLIC
Python::Module
PRIVATE
Python::Python
+ libunwind::libunwind
+ pybind11::pybind11
)
# Address linker issues with std::filesystem on Centos 8 and Debian
@@ -146,8 +144,6 @@ target_link_libraries(gnuradio-runtime PUBLIC $<$<AND:$<CXX_COMPILER_ID:GNU>,$<V
target_include_directories(gnuradio-runtime
PUBLIC
- ${PYTHON_NUMPY_INCLUDE_DIR}
- ${pybind11_INCLUDE_DIR}
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>