summaryrefslogtreecommitdiff
path: root/cmake/Modules/GrPython.cmake
diff options
context:
space:
mode:
authorTom Rondeau2012-11-22 09:59:57 -0500
committerTom Rondeau2012-11-22 09:59:57 -0500
commit4d6b277c28b8161ff7db9bade127bab5e03a38ef (patch)
treee5c24f6e3f68dc11be21b64b3e9e8feef4f09f66 /cmake/Modules/GrPython.cmake
parent20de05ea85ee09c7462fbddfe680eb1a87996dc7 (diff)
downloadgnuradio-4d6b277c28b8161ff7db9bade127bab5e03a38ef.tar.gz
gnuradio-4d6b277c28b8161ff7db9bade127bab5e03a38ef.tar.bz2
gnuradio-4d6b277c28b8161ff7db9bade127bab5e03a38ef.zip
cmake: Allow user to set Python installation directory from cmake.
cmake -DGR_PYTHON_DIR=<install path>
Diffstat (limited to 'cmake/Modules/GrPython.cmake')
-rw-r--r--cmake/Modules/GrPython.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 14f2b29cd..791114e05 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -96,11 +96,13 @@ endmacro(GR_PYTHON_CHECK_MODULE)
########################################################################
# Sets the python installation directory GR_PYTHON_DIR
########################################################################
+if(NOT DEFINED GR_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig
print sysconfig.get_python_lib(plat_specific=True, prefix='')
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
+endif()
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
########################################################################