aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Flynn <tflynn@redwiretechnology.com>2019-05-29 13:50:38 -0400
committerAndrej Rode <mail@andrejro.de>2019-07-17 23:44:26 +0200
commit5ae09071f9503edb13eccb0aefc72856a35a801a (patch)
tree23723ae6bd4eff24fda053341b32e3553f932153
parentFix for misc. documentation + trivial typos (diff)
downloadgnuradio-5ae09071f9503edb13eccb0aefc72856a35a801a.tar.xz
gnuradio-5ae09071f9503edb13eccb0aefc72856a35a801a.zip
Add GR_PYTHON_RELATIVE to fix issue #2515 with runtime_swigTargets-release.cmake
This commit fixes issue #2515. A new CMake variable, GR_PYTHON_RELATIVE is needed to properly create the CMake files used by OOTs when cross compiling or using sysroot based build systems see https://cmake.org/Bug/print_bug_page.php?bug_id=14367 for more information
-rw-r--r--cmake/Modules/GrPython.cmake13
-rw-r--r--gnuradio-runtime/swig/CMakeLists.txt2
2 files changed, 14 insertions, 1 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 38ebb4dd3..ff8264a9b 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -121,6 +121,19 @@ endif()
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
########################################################################
+# Sets the python relative installation directory GR_PYTHON_RELATIVE
+########################################################################
+if(NOT DEFINED GR_PYTHON_RELATIVE)
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "
+from distutils import sysconfig as sc
+print(sc.get_python_lib(prefix='', plat_specific=True))
+"
+ OUTPUT_VARIABLE GR_PYTHON_RELATIVE OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+endif()
+
+
+########################################################################
# Create an always-built target with a unique name
# Usage: GR_UNIQUE_TARGET(<description> <dependencies list>)
########################################################################
diff --git a/gnuradio-runtime/swig/CMakeLists.txt b/gnuradio-runtime/swig/CMakeLists.txt
index bade4beea..7cd2bc4fd 100644
--- a/gnuradio-runtime/swig/CMakeLists.txt
+++ b/gnuradio-runtime/swig/CMakeLists.txt
@@ -62,7 +62,7 @@ GR_SWIG_MAKE(runtime_swig runtime_swig.i)
install(
TARGETS runtime_swig
EXPORT runtime_swig-export
- DESTINATION ${GR_PYTHON_DIR}/gnuradio/gr
+ DESTINATION ${GR_PYTHON_RELATIVE}/gnuradio/gr
)
include(GrPython)