← Back to team overview

kicad-developers team mailing list archive

Re: Updated FindPython cmake modules

 

On 5/31/2016 11:03 AM, Simon Wells wrote:
> This patch isn't actually very good in its current state so i am
> currently rewriting it.
> 
> @Wayne, I notied the MINGW stuff you added including lines that search
> ${CURRENT_VERSION}.1-9 is that even worth it any more with the primary
> python2 distribution being 2.7.11?

This was added by Brian for his python-a-mingw-us builder.  I don't
think removing it would be an issue since Brian's kicad-winbuilder is no
longer supported.  @Brian, any comments on this.

> 
> The FindPythonInterp i am writing will search python2 then python then
> python2.latest and going older until it hits one, However before
> accepting a version it will test its version and make sure that major
> is the same and major.minor is equal to or greater than the value
> provided in Python_FIND_VERISON.
> 
> As i do not know all the pitfalls behind MINGW but have picked up a
> bit from the script is requestion 'python' a bad idea on MINGW?

This depends on the user's configuration.  On my msys2/mingw32 and
msys2/mingw64 platforms, `python --version` returns 2.7.11 however the
user could just as easily copy python3.exe to python.exe so you should
always check the version of the returned by the python executable (or
symlink on Posix platforms for that matter) just to make sure.  Also,
please make sure the user can always define a specific python path using
either an environment variable, cmake definition, or both.  A lot of
FindFoo.cmake files lack this feature which is a poor design.

> 
> thanks
> 
> Simon
> 
> On Sat, May 21, 2016 at 10:50 AM, Simon Wells <swel024@xxxxxxxxx> wrote:
>> heres the patch
>>
>> On Sat, May 21, 2016 at 10:49 AM, Simon Wells <swel024@xxxxxxxxx> wrote:
>>> Please find attached updated patch that removes
>>> CMakeModules/CMakeFindFrameworks.cmake
>>>
>>> Adam if you can test the patch it would be useful
>>>
>>> but based on when that file was last changed (in 2013) and is the same
>>> in the ubuntu 14.04 cmake 2.8.12 distribution  as it is in 3.5 which i
>>> use i don't think it should be an issue at all
>>>
>>> Simon
>>>
>>> On Thu, May 19, 2016 at 6:40 PM, Simon Wells <swel024@xxxxxxxxx> wrote:
>>>> Included are updated FindPython cmake modules, Using the current
>>>> FindPython*.cmake files with the mingw modifications from in tree. I
>>>> have been unable to test the mingw versions as i do not have a mingw
>>>> environment set up
>>>>
>>>> The reason i have updated these as currently the scripts first looks
>>>> for the version thats specified, aka FindPythonInterp 2.6 will prefer
>>>> version 2.6 to 2.7 so if both are installed then it requires
>>>> specifying. The new script i believe first checks the system python.
>>>> Again i am not sure if this will break mingw but i think it would be
>>>> better to modify the new version regardless.
>>>>
>>>> As part of this would it be better if we only included a
>>>> FindPythonInterp for mingw as it seems we only need the customisation
>>>> for mingw and we are losing the ability to just use updated scripts
>>>> for other operating systems
>>>>
>>>> Simon
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References