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)
+#-----------------------------------------------------------------------------
+
+
#-----------------------------------------------------------------------------
-MACRO(CREA_INSTALL_LIBRARY_FOR_CMAKE LIBRARY_NAME)
+MACRO(CREA_INSTALL_LIBRARY_FOR_CMAKE LIBRARY_NAME1)
# Sets the settings to default values
- SET(${LIBRARY_NAME}_INSTALL_FOLDER ${LIBRARY_NAME})
- SET(${LIBRARY_NAME}_LIBRARIES ${LIBRARY_NAME})
+ SET(${LIBRARY_NAME1}_INSTALL_FOLDER ${LIBRARY_NAME1})
+ SET(${LIBRARY_NAME1}_LIBRARIES ${LIBRARY_NAME1})
FILE(RELATIVE_PATH
- ${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
+ ${LIBRARY_NAME1}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
)
IF(UNIX)
- SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ SET(${LIBRARY_NAME1}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
${EXECUTABLE_OUTPUT_REL_PATH})
- SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
+ SET(${LIBRARY_NAME1}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
ELSE(UNIX)
- SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
+ SET(${LIBRARY_NAME1}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
${EXECUTABLE_OUTPUT_REL_PATH}/Debug
${EXECUTABLE_OUTPUT_REL_PATH}/Release)
- SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS bin)
+ SET(${LIBRARY_NAME1}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS bin)
ENDIF(UNIX)
- SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/${LIBRARY_NAME})
+ SET(${LIBRARY_NAME1}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/${LIBRARY_NAME1})
# Invoke the advanced macro
- CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
+ CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME1})
ENDMACRO(CREA_INSTALL_LIBRARY_FOR_CMAKE)