OPTION(BUILD_EXAMPLES "Build examples" OFF)
OPTION(BUILD_SHARED_LIBS "Build shared libs" OFF)
-OPTION(USE_VTK "Build using VTK" ON)
IF(BUILD_SHARED_LIBS)
SET(LIB_TYPE SHARED)
INCLUDE(GenerateExportHeader)
+FIND_PACKAGE(VTK REQUIRED)
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
-IF(USE_VTK)
- FIND_PACKAGE(VTK REQUIRED)
- INCLUDE(${VTK_USE_FILE})
+## Check for required modules
+IF(NOT ITKVtkGlue_LOADED)
+ MESSAGE(FATAL_ERROR "ITKVtkGlue module is required but not available.")
+ENDIF(NOT ITKVtkGlue_LOADED)
- OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF)
- IF(USE_cpPlugins)
- FIND_PACKAGE(cpPlugins REQUIRED)
- ENDIF(USE_cpPlugins)
-
-ENDIF(USE_VTK)
+OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF)
+IF(USE_cpPlugins)
+ FIND_PACKAGE(cpPlugins REQUIRED)
+ENDIF(USE_cpPlugins)
## ================================================
## = Do not allow to build inside the source tree =
TARGET_LINK_LIBRARIES(${EX} FrontAlgorithms)
ENDFOREACH(EX)
-IF(USE_VTK)
- SET(
- SIMPLE_VTK_EXAMPLES
- example_Image_RegionGrow_AllPixels
- example_Image_RegionGrow_AllRGBPixels
- example_Image_RegionGrow_GaussianModelEstimation
- example_Image_Dijkstra_CostFromInput
- example_Image_Dijkstra_CostFromRGBInput
- example_Image_Dijkstra_DanielssonCost
- example_Image_Dijkstra_DanielssonCost_TwoSeedsPath
- example_Image_Dijkstra_EndPointDetection
- example_ShowSkeleton
+SET(
+ SIMPLE_VTK_EXAMPLES
+ example_Image_RegionGrow_AllPixels
+ example_Image_RegionGrow_AllRGBPixels
+ example_Image_RegionGrow_GaussianModelEstimation
+ example_Image_Dijkstra_CostFromInput
+ example_Image_Dijkstra_CostFromRGBInput
+ example_Image_Dijkstra_DanielssonCost
+ example_Image_Dijkstra_DanielssonCost_TwoSeedsPath
+ example_Image_Dijkstra_EndPointDetection
+ example_ShowSkeleton
+ )
+FOREACH(EX ${SIMPLE_VTK_EXAMPLES})
+ ADD_EXECUTABLE(${EX} ${EX}.cxx)
+ TARGET_LINK_LIBRARIES(
+ ${EX} FrontAlgorithms
)
- FOREACH(EX ${SIMPLE_VTK_EXAMPLES})
- ADD_EXECUTABLE(${EX} ${EX}.cxx)
- TARGET_LINK_LIBRARIES(${EX} FrontAlgorithms)
- ENDFOREACH(EX)
-ENDIF(USE_VTK)
-
-#IF(BUILD_EXAMPLES)
-# SET(
-# APPLIS
-# example_Thinning
-# example_BinaryDistanceMap
-# example_HausdorffDistance
-# example_ImageAlgorithmRegionGrow_00
-# example_ImageAlgorithmDijkstra_00
-# example_ImageAlgorithmFastMarching_00
-# )
-
-# FOREACH(APP ${APPLIS})
-# ADD_EXECUTABLE(${APP} ${APP}.cxx)
-# TARGET_LINK_LIBRARIES(${APP} FrontAlgorithms)
-# ENDFOREACH(APP)
-
-# IF(USE_VTK)
-# SET(
-# vtk_APPLIS
-# example_ImageAlgorithmRegionGrow_01
-# example_ImageAlgorithmRegionGrow_MultipleThresholds
-# example_ImageAlgorithmDijkstra_01
-# example_ImageAlgorithmDijkstra_02
-# example_ImageAlgorithmDijkstra_03
-# example_ImageAlgorithmFastMarching_01
-# example_ImageAlgorithm_Skeletonization
-# )
-
-# FOREACH(APP ${vtk_APPLIS})
-# ADD_EXECUTABLE(${APP} ${APP}.cxx)
-# TARGET_LINK_LIBRARIES(
-# ${APP}
-# FrontAlgorithms
-# ${VTK_LIBRARIES} vtkIOLegacy
-# )
-# ENDFOREACH(APP)
-
-# IF(USE_cpPlugins)
-# SET(
-# cpPlugins_APPLIS
-# example_ImageAlgorithmRegionGrow_GaussianModelEstimator
-# )
-
-# FOREACH(APP ${cpPlugins_APPLIS})
-# ADD_EXECUTABLE(${APP} ${APP}.cxx)
-# TARGET_LINK_LIBRARIES(
-# ${APP}
-# FrontAlgorithms
-# ${cpPlugins_Extensions_LIBRARY_NAME}
-# )
-# ENDFOREACH(APP)
-
-# ENDIF(USE_cpPlugins)
-
-# ENDIF(USE_VTK)
-#ENDIF(BUILD_EXAMPLES)
+ENDFOREACH(EX)
## eof - $RCSfile$
FILE(GLOB ${LIB_NAME}_IO_SOURCES "fpa/IO/*.cxx")
FILE(GLOB ${LIB_NAME}_IMAGE_SOURCES "fpa/Image/*.cxx")
-IF(USE_VTK)
- FILE(GLOB ${LIB_NAME}_VTK_HEADERS "fpa/VTK/*.h" "fpa/VTK/*.hxx")
- FILE(GLOB ${LIB_NAME}_VTK_SOURCES "fpa/VTK/*.cxx")
-ENDIF(USE_VTK)
+FILE(GLOB ${LIB_NAME}_VTK_HEADERS "fpa/VTK/*.h" "fpa/VTK/*.hxx")
+FILE(GLOB ${LIB_NAME}_VTK_SOURCES "fpa/VTK/*.cxx")
SET(
${LIB_NAME}_ALL_SOURCES
EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/fpa/${LIB_NAME}_Export.h
STATIC_DEFINE ${LIB_NAME}_BUILT_AS_STATIC
)
-IF(USE_VTK)
- TARGET_LINK_LIBRARIES(
- ${LIB_NAME}
- ${${LIB_NAME}_LINK_LIBRARIES}
- ${ITK_LIBRARIES}
- vtkInteractionWidgets
- )
-ELSE(USE_VTK)
- TARGET_LINK_LIBRARIES(
- ${LIB_NAME}
- ${${LIB_NAME}_LINK_LIBRARIES}
- ${ITK_LIBRARIES}
- )
-ENDIF(USE_VTK)
+TARGET_LINK_LIBRARIES(
+ ${LIB_NAME}
+ ${${LIB_NAME}_LINK_LIBRARIES}
+ ${ITK_LIBRARIES}
+ vtkInteractionWidgets
+ )
## eof - $RCSfile$