MantisBT - VTK
View Issue Details
0014586VTK(No Category)public2014-02-20 03:442015-02-09 15:42
Jorge 
Ben Boeckel (Kitware) 
highminorhave not tried
closedfixed 
6.0.0 
6.2.0 
Kitware
incorrect functionality
0014586: error in vtkLocal with BUILD_SHARED_LIBS=ON
Hello I have an error when trying to build the example Examples/Build/vtkLocal outside the vtk build tree with BUILD_SHARED_LIBS=ON. My VTK was built with TCL wrapping ON. This bug has being also mentioned at http://stackoverflow.com/questions/19918691/how-do-i-build-the-vtklocal-example-with-shared-libraries-on [^]

If I remove the string -lTCL manually from the command line used to build the lib then shared lib is created correctly (I discovered the command line passing VERBOSE=1 to make).

I have test it with VTK 6.1.0 and cmake version 2.8.9.

Here I attach the CMakeCache.txt and the modified CMakeList.txt with BUILD_SHARED_LIBS=ON
No tags attached.
txt CMakeCache.txt (13,789) 2014-02-20 03:45
https://www.vtk.org/Bug/file/9612/CMakeCache.txt
txt CMakeLists.txt (526) 2014-02-20 03:45
https://www.vtk.org/Bug/file/9613/CMakeLists.txt
Issue History
2014-02-20 03:44JorgeNew Issue
2014-02-20 03:45JorgeFile Added: CMakeCache.txt
2014-02-20 03:45JorgeFile Added: CMakeLists.txt
2014-05-06 06:17JorgeNote Added: 0032618
2015-02-05 12:36Dave DeMarleAssigned To => Ben Boeckel (Kitware)
2015-02-05 12:37Dave DeMarleNote Added: 0034171
2015-02-07 21:53Dave DeMarleNote Added: 0034191
2015-02-07 21:53Dave DeMarleStatusbacklog => gerrit review
2015-02-09 15:42Ben Boeckel (Kitware)Note Added: 0034197
2015-02-09 15:42Ben Boeckel (Kitware)Statusgerrit review => closed
2015-02-09 15:42Ben Boeckel (Kitware)Resolutionopen => fixed
2015-02-09 15:42Ben Boeckel (Kitware)Fixed in Version => 6.2.0

Notes
(0032618)
Jorge   
2014-05-06 06:17   
I think the problem is located at vtkTclWrapping.cmake near the line 46

  foreach(dep ${${vtk-module}_LINK_DEPENDS})
    if(NOT "${vtk-module}" STREQUAL "${dep}")
      if(NOT ${dep}_EXCLUDE_FROM_WRAPPING)
        list(APPEND extra_links ${${dep}_TCL_NAME}TCL)
      endif()
    endif()
  endforeach()

vtkLocal depends on vtkCommonCore and ${${dep}_TCL_NAME} evaluate to empty "" and because of that TCL is appended to the extra_links.

I don't know why ${${dep}_TCL_NAME} is empty but changing the check:

  if(NOT ${dep}_EXCLUDE_FROM_WRAPPING)

for:

  if(NOT ${dep}_EXCLUDE_FROM_WRAPPING AND NOT "${${dep}_TCL_NAME}" STREQUAL "")

avoid the linking error in vtkLocal reported in this issue.
(0034171)
Dave DeMarle   
2015-02-05 12:37   
@ Ben please look at Jorge's change (thanks Jorge!) and see if it can go into 6.2.0.
If not change target to 6.2.1.
(0034191)
Dave DeMarle   
2015-02-07 21:53   
http://review.source.kitware.com/#/c/19155/ [^]
(0034197)
Ben Boeckel (Kitware)   
2015-02-09 15:42   
Gerrit branch has landed.