Browse Source

Do not link with VTK targets that don't exist

Julien Finet 11 years ago
parent
commit
ae008df8ff
1 changed files with 7 additions and 7 deletions
  1. 7 7
      Libs/Visualization/VTK/Core/CMakeLists.txt

+ 7 - 7
Libs/Visualization/VTK/Core/CMakeLists.txt

@@ -83,20 +83,20 @@ if(${VTK_VERSION_MAJOR} GREATER 5)
     vtkCommonDataModel
     vtkCommonSystem
     vtkIOImage
-    vtkIOMPIImage
     vtkInteractionStyle
     vtkRenderingAnnotation
     vtkRenderingCore
     vtkRenderingFreeTypeOpenGL
-    vtkRenderingMatplotlib
-    vtkRenderingFreeTypeFontConfig
     vtkRenderingOpenGL
     )
+  if(TARGET vtkIOMPIImage)
+    list(APPEND VTK_LIBRARIES vtkIOMPIImage )
+  endif()
+  if(TARGET vtkRenderingMatplotlib)
+    list(APPEND VTK_LIBRARIES vtkRenderingMatplotlib )
+  endif()
   if(TARGET vtkTestingRendering)
-    message("Testing exists")
-    list(APPEND VTK_LIBRARIES
-        vtkTestingRendering
-        )
+    list(APPEND VTK_LIBRARIES vtkTestingRendering )
   endif()
   if (TARGET vtkRenderingFreeTypeFontConfig AND UNIX AND NOT APPLE)
     find_package(FontConfig QUIET)