discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] GNU Radio Using MacPorts


From: Josh Blum
Subject: Re: [Discuss-gnuradio] GNU Radio Using MacPorts
Date: Wed, 21 Nov 2012 10:35:52 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]