Commit 1995122e authored by Bill Lorensen's avatar Bill Lorensen

ENH: Migrate examples to VTK6

1) Add Find_Package(VTK COMPONENTS) for each example dir
2) Add MAC app support
3) Use ${VTK_LIBRARIES} for target_link_libraries
4) Use new signature for add_test

Each set of examples can be built within the VTK bin tree or as
stand-alone examples.

Change-Id: I6daa126bcc2ed44d827b50954d27f90f394ad4f2
parent 6ad8a78b
......@@ -342,6 +342,10 @@ if(BUILD_TESTING)
add_subdirectory(Testing/Install)
endif()
if(BUILD_EXAMPLES)
add_subdirectory(Examples)
endif()
# The doxygen documentation needs to be aware of all modules.
option(BUILD_DOCUMENTATION "Build the VTK documentation" OFF)
if(BUILD_DOCUMENTATION)
......
PROJECT (AMR)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
IF (VTK_USE_MPI)
INCLUDE_DIRECTORIES("${MPI_INCLUDE_PATH} ${VTK_USE_FILE}")
IF (MPI_LIBRARY)
SET(MPI_LIBRARIES ${MPI_LIBRARY})
ENDIF (MPI_LIBRARY)
IF (MPI_EXTRA_LIBRARY)
SET(MPI_LIBRARIES ${MPI_LIBRARIES} "${MPI_EXTRA_LIBRARY}")
ENDIF (MPI_EXTRA_LIBRARY)
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK -DASSERT_ON")
ENDIF (VTK_USE_MPI)
PROJECT (AMR)
if(NOT VTK_SOURCE_DIR)
message(ERROR "Cannot build AMR examples without VTK_SOURCE_DIR")
endif()
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersAMR
vtkFiltersCore
vtkFiltersExtraction
vtkFiltersGeneral
vtkFiltersGeometry
vtkFiltersSources
vtkIOXML
vtkRenderingCore
vtkRenderingOpenGL
vtkTestingCore
)
include(${VTK_USE_FILE})
endif()
include_directories(
${VTK_SOURCE_DIR}/Testing/Core
)
## Add HierarchicalBoxPipeline executable
ADD_EXECUTABLE(HierarchicalBoxPipeline HierarchicalBoxPipeline.cxx)
TARGET_LINK_LIBRARIES(HierarchicalBoxPipeline vtkRendering vtkIO)
add_executable(HierarchicalBoxPipeline MACOSX_BUNDLE HierarchicalBoxPipeline.cxx)
target_link_libraries(HierarchicalBoxPipeline ${VTK_LIBRARIES})
## Add AMR examples
IF (VTK_USE_PARALLEL AND VTK_USE_MPI )
ADD_EXECUTABLE( Generate3DAMRDataSetWithPulse Generate3DAMRDataSetWithPulse.cxx)
TARGET_LINK_LIBRARIES( Generate3DAMRDataSetWithPulse
vtkGraphics
vtkFiltering
vtkRendering
vtkIO
vtkAMR
vtkParallel
${MPI_LIBRARIES}
${VTK_HDF5_LIBRARIES}
)
add_executable( Generate3DAMRDataSetWithPulse MACOSX_BUNDLE Generate3DAMRDataSetWithPulse.cxx)
target_link_libraries( Generate3DAMRDataSetWithPulse ${VTK_LIBRARIES})
ADD_EXECUTABLE( Generate2DAMRDataSetWithPulse Generate2DAMRDataSetWithPulse.cxx)
TARGET_LINK_LIBRARIES( Generate2DAMRDataSetWithPulse
vtkGraphics
vtkFiltering
vtkRendering
vtkIO
vtkAMR
vtkParallel
${MPI_LIBRARIES}
${VTK_HDF5_LIBRARIES}
)
ENDIF (VTK_USE_PARALLEL AND VTK_USE_MPI)
\ No newline at end of file
add_executable( Generate2DAMRDataSetWithPulse MACOSX_BUNDLE Generate2DAMRDataSetWithPulse.cxx)
target_link_libraries(Generate2DAMRDataSetWithPulse ${VTK_LIBRARIES})
PROJECT (LabeledMesh)
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE (${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
PROJECT (LabeledMesh)
SET(Libraries vtkRendering)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
vtkFiltersGeneral
vtkFiltersSources
vtkRenderingCore
vtkRenderingLabel
vtkRenderingOpenGL
vtkRenderingFreeTypeOpenGL
)
include (${VTK_USE_FILE})
endif()
ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_NAME}.cxx)
set(Libraries ${VTK_LIBRARIES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${Libraries})
add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${PROJECT_NAME}.cxx)
target_link_libraries(${PROJECT_NAME} ${Libraries})
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT(VTKExamples)
INCLUDE_REGULAR_EXPRESSION("^.*$")
include_regular_expression("^.*$")
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_BINARY_DIR)
find_package(VTK REQUIRED)
else()
set(VTK_DIR ${VTK_BINARY_DIR})
find_package(VTK REQUIRED)
endif()
# Most examples require rendering support.
IF(VTK_USE_RENDERING)
ADD_SUBDIRECTORY(Build/vtkLocal)
ADD_SUBDIRECTORY(Build/vtkMy)
ADD_SUBDIRECTORY(AMR/Cxx)
ADD_SUBDIRECTORY(Annotation/Cxx/LabeledMesh)
ADD_SUBDIRECTORY(MultiBlock/Cxx)
ADD_SUBDIRECTORY(GUI/Motif)
ADD_SUBDIRECTORY(DataManipulation/Cxx)
ADD_SUBDIRECTORY(Hybrid/Cxx)
ADD_SUBDIRECTORY(ImageProcessing/Cxx)
ADD_SUBDIRECTORY(IO/Cxx)
ADD_SUBDIRECTORY(Medical/Cxx)
ADD_SUBDIRECTORY(Modelling/Cxx)
ADD_SUBDIRECTORY(Rendering/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step1/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step2/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step3/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step4/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step5/Cxx)
ADD_SUBDIRECTORY(Tutorial/Step6/Cxx)
ADD_SUBDIRECTORY(VisualizationAlgorithms/Cxx)
ADD_SUBDIRECTORY(VolumeRendering/Cxx)
ADD_SUBDIRECTORY(Widgets/Cxx)
IF(VTK_USE_PARALLEL)
ADD_SUBDIRECTORY(ParallelProcessing)
ENDIF(VTK_USE_PARALLEL)
include(${VTK_USE_FILE})
IF(VTK_USE_INFOVIS)
IF(VTK_USE_CHARTS)
ADD_SUBDIRECTORY(Charts/Cxx)
ENDIF(VTK_USE_CHARTS)
ADD_SUBDIRECTORY(Infovis/Cxx)
IF(VTK_USE_N_WAY_ARRAYS)
ADD_SUBDIRECTORY(Array/Cxx)
ENDIF(VTK_USE_N_WAY_ARRAYS)
ENDIF(VTK_USE_INFOVIS)
IF(VTK_USE_QVTK)
ADD_SUBDIRECTORY(GUI/Qt)
ENDIF(VTK_USE_QVTK)
IF(WIN32)
ADD_SUBDIRECTORY(GUI/Win32/SimpleCxx)
IF(VTK_USE_MFC)
ADD_SUBDIRECTORY(GUI/Win32/SampleMFC)
ADD_SUBDIRECTORY(GUI/Win32/vtkMFC)
ENDIF(VTK_USE_MFC)
ENDIF(WIN32)
ENDIF(VTK_USE_RENDERING)
if (NOT vtkRenderingCore_LOADED)
message(STATUS "vtkRenderingCore not found. No examples will be built")
else()
add_subdirectory(AMR/Cxx)
add_subdirectory(Annotation/Cxx/LabeledMesh)
add_subdirectory(MultiBlock/Cxx)
add_subdirectory(DataManipulation/Cxx)
add_subdirectory(Hybrid/Cxx)
add_subdirectory(ImageProcessing/Cxx)
add_subdirectory(IO/Cxx)
add_subdirectory(Medical/Cxx)
add_subdirectory(Modelling/Cxx)
add_subdirectory(Rendering/Cxx)
add_subdirectory(Tutorial/Step1/Cxx)
add_subdirectory(Tutorial/Step2/Cxx)
add_subdirectory(Tutorial/Step3/Cxx)
add_subdirectory(Tutorial/Step4/Cxx)
add_subdirectory(Tutorial/Step5/Cxx)
add_subdirectory(Tutorial/Step6/Cxx)
add_subdirectory(VisualizationAlgorithms/Cxx)
add_subdirectory(VolumeRendering/Cxx)
add_subdirectory(Widgets/Cxx)
# add_subdirectory(Build/vtkLocal)
# add_subdirectory(Build/vtkMy)
# add_subdirectory(GUI/Motif)
# IF(VTK_USE_PARALLEL)
# add_subdirectory(ParallelProcessing)
# ENDIF(VTK_USE_PARALLEL)
#
# IF(VTK_USE_INFOVIS)
# IF(VTK_USE_CHARTS)
# add_subdirectory(Charts/Cxx)
# ENDIF(VTK_USE_CHARTS)
# add_subdirectory(Infovis/Cxx)
# IF(VTK_USE_N_WAY_ARRAYS)
# add_subdirectory(Array/Cxx)
# ENDIF(VTK_USE_N_WAY_ARRAYS)
# ENDIF(VTK_USE_INFOVIS)
# IF(VTK_USE_QVTK)
# add_subdirectory(GUI/Qt)
# ENDIF(VTK_USE_QVTK)
# IF(WIN32)
# add_subdirectory(GUI/Win32/SimpleCxx)
# IF(VTK_USE_MFC)
# add_subdirectory(GUI/Win32/SampleMFC)
# add_subdirectory(GUI/Win32/vtkMFC)
# ENDIF(VTK_USE_MFC)
# ENDIF(WIN32)
endif()
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (DataManipulation)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
vtkFiltersGeometry
vtkRenderingCore
vtkRenderingOpenGL
vtkInteractionStyle
)
include(${VTK_USE_FILE})
endif()
ADD_EXECUTABLE(Arrays Arrays.cxx)
ADD_EXECUTABLE(Cube Cube.cxx)
ADD_EXECUTABLE(SGrid SGrid.cxx)
ADD_EXECUTABLE(RGrid RGrid.cxx)
add_executable(Arrays MACOSX_BUNDLE Arrays.cxx)
add_executable(Cube MACOSX_BUNDLE Cube.cxx)
add_executable(SGrid MACOSX_BUNDLE SGrid.cxx)
add_executable(RGrid MACOSX_BUNDLE RGrid.cxx)
TARGET_LINK_LIBRARIES(Arrays vtkRendering)
TARGET_LINK_LIBRARIES(Cube vtkRendering)
TARGET_LINK_LIBRARIES(SGrid vtkRendering)
TARGET_LINK_LIBRARIES(RGrid vtkRendering)
target_link_libraries(Arrays ${VTK_LIBRARIES})
target_link_libraries(Cube ${VTK_LIBRARIES})
target_link_libraries(SGrid ${VTK_LIBRARIES})
target_link_libraries(RGrid ${VTK_LIBRARIES})
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (Hybrid)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_SOURCE_DIR)
message(ERROR "Cannot build Hybrid examples without VTK_SOURCE_DIR")
endif()
if(NOT VTK_BINARY_DIR)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
endif()
INCLUDE_DIRECTORIES(
include_directories(
# ImageDataLIC2DDemo and StructuredGridLIC2DDemo include
# TestImageDataLIC2D.h and TestStructuredGridLIC2DSlice
# from the dir below
${VTK_SOURCE_DIR}/Hybrid/Testing/Cxx
${VTK_SOURCE_DIR}/Rendering/HybridOpenGL/Testing/Cxx
)
SET(HYBRID_EXAMPLES_SRCS
set(HYBRID_EXAMPLES_SRCS
ImageDataLIC2DDemo
StructuredGridLIC2DDemo
)
IF(APPLE)
SET(EXECUTABLE_FLAG MACOSX_BUNDLE)
ENDIF(APPLE)
FOREACH(name ${HYBRID_EXAMPLES_SRCS})
ADD_EXECUTABLE(${name} ${EXECUTABLE_FLAG} ${name}.cxx)
TARGET_LINK_LIBRARIES(${name} vtkHybrid )
ENDFOREACH(name)
foreach(name ${HYBRID_EXAMPLES_SRCS})
add_executable(${name} MACOSX_BUNDLE ${name}.cxx)
target_link_libraries(${name} ${VTK_LIBRARIES} )
endforeach()
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (IO)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkIOGeometry
vtkIOXML
vtkRenderingOpenGL
)
include(${VTK_USE_FILE})
endif()
ADD_EXECUTABLE(DumpXMLFile DumpXMLFile.cxx)
TARGET_LINK_LIBRARIES(DumpXMLFile vtkIO vtkGraphics)
add_executable(DumpXMLFile MACOSX_BUNDLE DumpXMLFile.cxx)
target_link_libraries(DumpXMLFile ${VTK_LIBRARIES})
ADD_EXECUTABLE(ParticleReader ParticleReader.cxx)
TARGET_LINK_LIBRARIES(ParticleReader vtkHybrid)
add_executable(ParticleReader MACOSX_BUNDLE ParticleReader.cxx)
target_link_libraries(ParticleReader ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
SET(KIT IOExamples)
SET(MyTests TestDumpXMLFile.cxx TestParticleReader.cxx)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets)
IF (VTK_DATA_ROOT)
ADD_TEST(${KIT}-ParticleReader ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestParticleReader
${VTK_DATA_ROOT}/Data/golf.csv
${VTK_TEST_OUTPUT_DIR}/TestParticleReader.vtp)
ADD_TEST(${KIT}-DumpXMLFile ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestDumpXMLFile
${VTK_DATA_ROOT}/Data/cow.vtp)
ENDIF (VTK_DATA_ROOT)
include("${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.cmake")
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-ParticleReader COMMAND ${KIT}CxxTests
TestParticleReader
${VTK_DATA_ROOT}/Data/golf.csv
${VTK_TEST_OUTPUT_DIR}/TestParticleReader.vtp)
add_test(NAME ${KIT}-DumpXMLFile COMMAND ${KIT}CxxTests
TestDumpXMLFile
${VTK_DATA_ROOT}/Data/cow.vtp)
endif()
endif()
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT(ImageProcessing)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonMath
vtkIOImage
vtkImagingCore
vtkInteractionStyle
vtkRenderingCore
vtkRenderingOpenGL
)
include(${VTK_USE_FILE})
endif()
ADD_EXECUTABLE(ImageSlicing ImageSlicing.cxx)
TARGET_LINK_LIBRARIES(ImageSlicing vtkRendering vtkImaging vtkIO)
add_executable(ImageSlicing MACOSX_BUNDLE ImageSlicing.cxx)
target_link_libraries(ImageSlicing ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
SET(KIT ImageProcessingExamples)
SET(MyTests TestImageSlicing.cxx)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkIO)
ADD_TEST(${KIT}-ImageSlicing ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestImageSlicing ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(KIT ImageProcessingExamples)
set(MyTests TestImageSlicing.cxx)
include("${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.cmake")
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-ImageSlicing COMMAND ${KIT}CxxTests
TestImageSlicing ${VTK_DATA_ROOT}/Data/headsq/quarter)
endif()
endif()
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (Medical)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(Medical1 Medical1.cxx)
ADD_EXECUTABLE(Medical2 Medical2.cxx)
ADD_EXECUTABLE(Medical3 Medical3.cxx)
ADD_EXECUTABLE(Medical4 Medical4.cxx)
TARGET_LINK_LIBRARIES(Medical1 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(Medical2 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(Medical3 vtkRendering vtkIO)
TARGET_LINK_LIBRARIES(Medical4 vtkVolumeRendering vtkIO)
IF(VTK_USE_METAIO)
ADD_EXECUTABLE(GenerateModelsFromLabels GenerateModelsFromLabels.cxx)
ADD_EXECUTABLE(GenerateCubesFromLabels GenerateCubesFromLabels.cxx)
TARGET_LINK_LIBRARIES(GenerateModelsFromLabels vtkHybrid vtkIO)
TARGET_LINK_LIBRARIES(GenerateCubesFromLabels vtkHybrid vtkIO)
ENDIF(VTK_USE_METAIO)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkCommonTransforms
vtkFiltersCore
vtkFiltersGeneral
vtkFiltersGeometry
vtkFiltersModeling
vtkIOImage
vtkIOXML
vtkImagingCore
vtkImagingStatistics
vtkRenderingCore
vtkRenderingOpenGL
vtkRenderingVolume
vtkRenderingVolumeOpenGL
vtkInteractionStyle
)
include(${VTK_USE_FILE})
endif()
add_executable(Medical1 MACOSX_BUNDLE Medical1.cxx)
add_executable(Medical2 MACOSX_BUNDLE Medical2.cxx)
add_executable(Medical3 MACOSX_BUNDLE Medical3.cxx)
add_executable(Medical4 MACOSX_BUNDLE Medical4.cxx)
target_link_libraries(Medical1 ${VTK_LIBRARIES})
target_link_libraries(Medical2 ${VTK_LIBRARIES})
target_link_libraries(Medical3 ${VTK_LIBRARIES})
target_link_libraries(Medical4 ${VTK_LIBRARIES})
add_executable(GenerateModelsFromLabels MACOSX_BUNDLE GenerateModelsFromLabels.cxx)
add_executable(GenerateCubesFromLabels MACOSX_BUNDLE GenerateCubesFromLabels.cxx)
target_link_libraries(GenerateModelsFromLabels ${VTK_LIBRARIES})
target_link_libraries(GenerateCubesFromLabels ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
SET(KIT MedicalExamples)
SET(MyTests TestMedical1.cxx TestMedical2.cxx TestMedical3.cxx TestMedical4.cxx)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets vtkVolumeRendering)
ADD_TEST(${KIT}-Medical1 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical1 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical2 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical2 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical3 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical3 ${VTK_DATA_ROOT}/Data/headsq/quarter)
ADD_TEST(${KIT}-Medical4 ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestMedical4 ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(KIT MedicalExamples)
set(MyTests TestMedical1.cxx TestMedical2.cxx TestMedical3.cxx TestMedical4.cxx)
include("${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.cmake")
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-Medical1 COMMAND ${KIT}CxxTests
TestMedical1 ${VTK_DATA_ROOT}/Data/headsq/quarter)
add_test(NAME ${KIT}-Medical2 COMMAND ${KIT}CxxTests
TestMedical2 ${VTK_DATA_ROOT}/Data/headsq/quarter)
add_test(NAME ${KIT}-Medical3 COMMAND ${KIT}CxxTests
TestMedical3 ${VTK_DATA_ROOT}/Data/headsq/quarter)
add_test(NAME ${KIT}-Medical4 COMMAND ${KIT}CxxTests
TestMedical4 ${VTK_DATA_ROOT}/Data/headsq/quarter)
endif()
endif()
PROJECT (Modelling)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
ADD_EXECUTABLE(finance finance.cxx)
TARGET_LINK_LIBRARIES(finance vtkRendering)
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
ADD_EXECUTABLE(Delaunay3D Delaunay3D.cxx)
TARGET_LINK_LIBRARIES(Delaunay3D vtkHybrid)
ADD_EXECUTABLE(Delaunay3DAlpha Delaunay3DAlpha.cxx)
TARGET_LINK_LIBRARIES(Delaunay3DAlpha vtkHybrid)
PROJECT (Modelling)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkFiltersCore
vtkFiltersGeneral
vtkIOXML
vtkImagingHybrid
vtkRenderingCore
vtkRenderingOpenGL
vtkInteractionStyle
)
include(${VTK_USE_FILE})
endif()
add_executable(finance MACOSX_BUNDLE finance.cxx)
target_link_libraries(finance ${VTK_LIBRARIES})
add_executable(Delaunay3D MACOSX_BUNDLE Delaunay3D.cxx)
target_link_libraries(Delaunay3D ${VTK_LIBRARIES})
add_executable(Delaunay3DAlpha MACOSX_BUNDLE Delaunay3DAlpha.cxx)
target_link_libraries(Delaunay3DAlpha ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
SET(KIT ModellingExamples)
SET(MyTests TestFinance.cxx TestDelaunay3D.cxx TestDelaunay3DAlpha.cxx)
INCLUDE(vtkTestingObjectFactory)
ADD_EXECUTABLE(${KIT}CxxTests ${KIT}CxxTests.cxx
${MyTests})
TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkRendering vtkWidgets)
IF (VTK_DATA_ROOT)
ADD_TEST(${KIT}-Finance ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestFinance ${VTK_DATA_ROOT}/Data/financial.txt)
ADD_TEST(${KIT}-Delaunay3D ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestDelaunay3D
${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3D.vtu)
ADD_TEST(${KIT}-Delaunay3DAlpa ${EXECUTABLE_OUTPUT_PATH}/${KIT}CxxTests
TestDelaunay3DAlpha
.5 ${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3DAlpha.vtu)
ENDIF (VTK_DATA_ROOT)
set(KIT ModellingExamples)
set(MyTests TestFinance.cxx TestDelaunay3D.cxx TestDelaunay3DAlpha.cxx)
include("${vtkTestingRendering_SOURCE_DIR}/vtkTestingObjectFactory.cmake")
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_LIBRARIES(${KIT}CxxTests ${VTK_LIBRARIES})
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-Finance COMMAND ${KIT}CxxTests
TestFinance ${VTK_DATA_ROOT}/Data/financial.txt)
add_test(NAME ${KIT}-Delaunay3D COMMAND ${KIT}CxxTests
TestDelaunay3D
${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3D.vtu)
add_test(NAME ${KIT}-Delaunay3DAlpa COMMAND ${KIT}CxxTests
TestDelaunay3DAlpha
.5 ${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3DAlpha.vtu)
endif()
endif()
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (MultiBlock)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_BINARY_DIR)
find_package(VTK COMPONENTS
vtkCommonCore
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersCore
vtkFiltersGeneral
vtkFiltersGeometry
vtkFiltersSources
vtkIOXML
vtkRenderingCore
vtkRenderingOpenGL
vtkTestingCore
)
include(${VTK_USE_FILE})
endif()
ADD_EXECUTABLE(MultiBlock MultiBlock.cxx)
TARGET_LINK_LIBRARIES(MultiBlock vtkRendering vtkIO)
add_executable(MultiBlock MACOSX_BUNDLE MultiBlock.cxx)
target_link_libraries(MultiBlock ${VTK_LIBRARIES})
cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
PROJECT (Rendering)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
if(NOT VTK_SOURCE_DIR)
message(ERROR " Cannot build Rendering examples without VTK_SOURCE_DIR")
endif()
INCLUDE_DIRECTORIES(