summaryrefslogtreecommitdiff
path: root/cmake/Modules
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 /cmake/Modules
parent925e1103e5791dc8be684a5269efc36c1bf4f557 (diff)
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
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/GrPython.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 38ebb4dd30..ff8264a9b9 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>)
########################################################################