Browse Source

Make VTK6 linking more robust

Check for the existence of some libraries and fix underlinked
Debian libs
Marco Nolden 11 years ago
parent
commit
4c54ae0368
1 changed files with 13 additions and 2 deletions
  1. 13 2
      Libs/Visualization/VTK/Core/CMakeLists.txt

+ 13 - 2
Libs/Visualization/VTK/Core/CMakeLists.txt

@@ -76,18 +76,29 @@ endif()
 # Set VTK_LIBRARIES variable
 if(${VTK_VERSION_MAJOR} GREATER 5)
   set(VTK_LIBRARIES
+    # a few of these have to be specified explicitly to workaround
+    # underlinked libraries from the debian VTK package
+    # see Debian bug #747436
     vtkCommonCore
     vtkCommonDataModel
     vtkCommonSystem
     vtkIOImage
+    vtkIOMPIImage
     vtkInteractionStyle
     vtkRenderingAnnotation
     vtkRenderingCore
     vtkRenderingFreeTypeOpenGL
+    vtkRenderingMatplotlib
+    vtkRenderingFreeTypeFontConfig
     vtkRenderingOpenGL
-    vtkTestingRendering
     )
-  if (UNIX AND NOT APPLE)
+  if(TARGET vtkTestingRendering)
+    message("Testing exists")
+    list(APPEND VTK_LIBRARIES
+        vtkTestingRendering
+        )
+  endif()
+  if (TARGET vtkRenderingFreeTypeFontConfig AND UNIX AND NOT APPLE)
     find_package(FontConfig QUIET)
     if (FONTCONFIG_FOUND)
       list(APPEND VTK_LIBRARIES