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: Tom Rondeau
Subject: Re: [Discuss-gnuradio] GNU Radio Using MacPorts
Date: Thu, 22 Nov 2012 09:53:26 -0500

On Wed, Nov 21, 2012 at 1:35 PM, Josh Blum <address@hidden> wrote:
>
>> 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

Yes, that's better. More what I was going for originally, too. Thanks.

Tom



reply via email to

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