[CMake] CMake finds the wrong Python interpreter on Windows

Bill Hoffman bill.hoffman at kitware.com
Wed Feb 24 17:20:15 EST 2010


Noel O'Boyle wrote:
> Hello all,
> 
> With the following CMakeLists.txt on Windows...
> 
> project("MyProject" NONE)
> find_package(PythonInterp)
> find_package(PythonLibs)
> 
> Using CMake 2.6.4 (or CMake 2.8), I get
> 
> -- Found PythonInterp: C:/Cygwin/bin/python2.5.exe
> -- Found PythonLibs: C:/Python26/libs/python26.lib
> 
> instead of
> 
> -- Found PythonInterp: C:/Python26/python.exe
> -- Found PythonLibs: C:/Python26/libs/python26.lib
> 
> This is a Windows XP machine, with standard installs of Python 2.5 and
> 2.6 and a standard Cygwin install of Python 2.5, where my PATH
> includes C:\Python26 before C:\Cygwin\bin. Why doesn't CMake just use
> the Python interpreter on my path as a first appoximation?
> 
It should use the one in your PATH...   What is your PATH set to? Might 
be something in the PATH that confuses CMake...   I have seen issues 
with " in the PATH.

-Bill


More information about the CMake mailing list