[vtkusers] VTK CVS: Build problems with Python
Andy Cedilnik
andy.cedilnik at kitware.com
Tue Jan 28 10:32:46 EST 2003
Hi Gavin,
Thank you for bug report. VTK CMakeLists files are fixed and it should
work now on CMake 1.4 and on CMake 1.6 when BUILD_TESTING is off. Could
you please try again?
Thank you.
Andy
On Mon, 2003-01-27 at 21:03, Gavin Baker wrote:
> I am building VTK from CVS (checked out morning of 28-Jan AEST) on
> Debian woody, with gcc 2.95.4 and Python 2.2.1, and CMake 1.4p4.
>
> I did a clean cvs checkout, ran 'cmake -i ../VTK' and straight away
> get this error:
>
> CMake Error: ADD_CUSTOM_COMMAND: Error :
> ADD_CUSTOM_COMMAND Wrong syntax: Empty COMMAND. from CMakeLists.txt file in
> directory /home/gavinb/projects/vtk/VTK/Wrapping/Python
>
> (repeated 12 times)
>
> (It is most unfortunate that the error messages from CMake do not
> include the line number of the error.)
>
> I tracked down the problem to this entry in VTK/Wrapping/Python/CMakeLists.txt
> on line 83:
>
> ADD_CUSTOM_COMMAND(SOURCE ${src}
> COMMAND ${PYTHON_EXECUTABLE}
> ARGS -c "\"import" "py_compile;py_compile.compile('${src}','${tgt}','${tgt}')\""
> TARGET vtkpython_pyc
> OUTPUTS ${tgt}
> )
>
> The problem is that PYTHON_EXECUTABLE isn't being set, and in the top
> level CMakLists.txt, the FIND_PROGRAM for Python has some problems: it
> is only getting set if BUILD_TESTING and DART_ROOT are both set, and
> secondly, the PATHs are only provided for Windows (pulling them out of
> the registry by the looks).
>
> I think this could be fixed with something like this:
>
> IF(VTK_WRAP_PYTHON)
> IF(WIN32)
> FIND_PROGRAM(PYTHON_EXECUTABLE
> NAMES python2.2 python2.1 python1.6 python1.5 python
> PATHS
> [HKEY_LOCAL_MACHINE...] # as in current version
> )
> END(WIN32)
> IF(UNIX)
> FIND_PROGRAM(PYTHON_EXECUTABLE
> NAMES python2.2 python2.1 python1.6 python1.5 python
> PATHS
> /usr/bin
> /usr/local/bin
> /opt/bin
> )
> END(UNIX)
> END(VTK_WRAP_PYTHON)
>
> The workaround is to invoke cmake like this:
>
> % ccmake -i ../VTK -DPYTHON_EXECUTABLE:FILE=/usr/bin/python2.2
>
> Note that if you put a space after the -D, CMake doesn't handle it too
> gracefully, and gives a strange error that doesn't really reflect the
> actual problem.
>
> :: Gavin
More information about the vtkusers
mailing list