[vtk-developers] [VTK 0011750]: CMake generates wrong VTKConfigure.H while using Python Debuggable

Mantis Bug Tracker mantis at public.kitware.com
Mon Jan 24 02:33:25 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=11750 
====================================================================== 
Reported By:                Gopalakrishna Palem
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   11750
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-01-24 02:33 EST
Last Modified:              2011-01-24 02:33 EST
====================================================================== 
Summary:                    CMake generates wrong VTKConfigure.H while using
Python Debuggable
Description: 
For a debug build, the pre-processor constant VTK_WINDOWS_PYTHON_DEBUGGABLE is
not being defined in the VTKConfigure.h file generated by CMake, even though a
correct Python Debuggable library is supplied. 

This is because of bug in the CMakeLists: The CONFIGURE_FILE() is placed
*before* the Python detection code INCLUDE(vtkWrapPython)

I have moved the CONFIGURE_FILE() code to after the INCLUDE(vtkWrapPython) and
now it generates correctly. Attaching the modified CMakeLists file.

Steps to Reproduce: 
Configure a correct version of Python debuggable library in the CMake and
generate the solution for VS2010. 

VTKConfigure.h gets generated with VTK_WINDOWS_PYTHON_DEBUGGABLE undefined. This
leads to _DEBUG being undefined in vtkPython.h because of a hack at line 35
there.

You will get linker errors because the pYConfig.h specifies a default
python27.lib, which conflicts with our supplied python27_d.lib.

#			ifdef _DEBUG
#				pragma comment(lib,"python27_d.lib")
#			else
#				pragma comment(lib,"python27.lib")
#			endif /* _DEBUG */


Additional Information: 


The order in CMakeLists is wrong. The correct order should be as below (attached
the correctly modified complete file):


#-----------------------------------------------------------------------------
# search Python, Tcl and Java

IF(VTK_WRAP_PYTHON)
  # Tell vtkWrapPython.cmake to set VTK_PYTHON_LIBRARIES for us.
  SET(VTK_WRAP_PYTHON_FIND_LIBS 1)
  INCLUDE(vtkWrapPython)
ENDIF(VTK_WRAP_PYTHON)


#-----------------------------------------------------------------------------
# Configure files with settings for use by the build.
CONFIGURE_FILE(${VTK_SOURCE_DIR}/vtkConfigure.h.in
               ${VTK_BINARY_DIR}/vtkConfigure.h @ONLY IMMEDIATE)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-24 02:33 Gopalakrishna PalemNew Issue                                   

2011-01-24 02:33 Gopalakrishna PalemFile Added: CMakeLists.txt                  
 
======================================================================




More information about the vtk-developers mailing list