]> Creatis software - crea.git/blobdiff - AdditionalcreaConfig.cmake.in
bug fixes
[crea.git] / AdditionalcreaConfig.cmake.in
index 9c91b5cf5591de64b6edba84c3235cb27dc94664..3af959d843fd227348800b6b7e37dc79de7cd6fd 100644 (file)
@@ -19,8 +19,45 @@ IF(CREA_VERBOSE_CMAKE)
 ENDIF(CREA_VERBOSE_CMAKE)
 #-----------------------------------------------------------------------------
 
-# If crea was compiled with WxWidget then have to find it
-#IF(CREA_BUILT_WITH_WX)
-#  INCLUDE(${CREA_CMAKE_DIR}/CREAWxWidgets.cmake)
-#  CREA_FIND_WXWIDGETS()
-#ENDIF(CREA_BUILT_WITH_WX)
+# If crea was compiled with WxWidget or vtk then have to find them : for now forced (see root CMakeLists.txt)
+SET(USE_WXWIDGETS ON)
+SET(USE_VTK ON)
+
+INCLUDE(${CREA_CMAKE_DIR}/CREAMacros.cmake)
+
+#-----------------------------------------------------------------------------
+IF(USE_VTK)
+  # Search VTK
+  FIND_PACKAGE(VTK)
+  # If vtk found
+  IF(VTK_FOUND)
+    MESSAGE ( STATUS "Looking for VTK... found")
+    MESSAGE ( STATUS "* Dir     = ${VTK_DIR}")
+    MESSAGE ( STATUS "* Version = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
+    INCLUDE(${VTK_USE_FILE})
+    CREA_DEFINE( USE_VTK )
+    SET(VTK_LIBRARIES
+      vtkImaging  vtkGraphics vtkRendering vtkFiltering vtkCommon vtkWidgets
+      vtkVolumeRendering
+      # LG : removed vtkIO because conflict with itktiff lib in ITKIO 
+      ) 
+    IF(NOT USE_ITK)
+     SET(VTK_LIBRARIES ${VTK_LIBRARIES} vtkIO)
+    ENDIF(NOT USE_ITK)
+    MARK_AS_ADVANCED(VTK_DIR)
+  ELSE(VTK_FOUND)
+     message(FATAL_ERROR "VTK_DIR not found")
+  ENDIF(VTK_FOUND)
+ENDIF(USE_VTK)
+#-----------------------------------------------------------------------------
+
+
+#-----------------------------------------------------------------------------
+IF(USE_WXWIDGETS)
+  INCLUDE(${CREA_CMAKE_DIR}/CREAMacro_wxWidgets.cmake)
+  CREA_FIND_WXWIDGETS()
+  CREA_USE_WXWIDGETS()
+ENDIF(USE_WXWIDGETS)
+#-----------------------------------------------------------------------------
+
+