> This always gets set in GrPython.cmake, but this simple patch would > allow us to set it on the cmake command line with > "-DGR_PYTHON_DIR=<your destination>": > > diff --git a/cmake/Modules/GrPython.cmake > b/cmake/Modules/GrPython.cmake index 14f2b29..5287955 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(GR_PYTHON_DIR STREQUAL "") > 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) > > ######################################################################## > > > > I'm not sure if this is the 'cmake way' of doing something like > this, but it's simple and works. >
That seems like the right idea to me, we already do this for PYTHON_EXECUTABLE. I would just do if(NOT DEFINED GR_PYTHON_DIR) Otherwise, cmake might be kind of funny when the var is undefined. -josh _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio