Commit 61511f37 authored by Bill Lorensen's avatar Bill Lorensen Committed by Dave DeMarle

BUG: Examples should build if BUILD_TESTING is OFF

With BUILD_EXAMPLES:ON and BUILD_TESTING:OFF, the Examples should
compile.

To configure VTK with BUILD_EXAMPLES:ON and BUILD_TESTING:OFF, from an
empty build tree,

cmake  -DBUILD_TESTING:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release vtk_src_tree

NOTE: If you have already configured VTK with default settings, you
must clean the build tree and rerun cmake with the above
setting. Otherwise, bogus tests will remain.

Conflicts:
	Examples/IO/Cxx/CMakeLists.txt
	Examples/ImageProcessing/Cxx/CMakeLists.txt
	Examples/Medical/Cxx/CMakeLists.txt
	Examples/Modelling/Cxx/CMakeLists.txt
	Examples/VisualizationAlgorithms/Cxx/CMakeLists.txt
	Examples/Widgets/Cxx/CMakeLists.txt

Change-Id: I996065a30aab43cca630a369b39d748de728039b
parent 7d82f600
......@@ -23,7 +23,9 @@ set(HYBRID_EXAMPLES_SRCS
StructuredGridLIC2DDemo
)
foreach(name ${HYBRID_EXAMPLES_SRCS})
add_executable(${name} MACOSX_BUNDLE ${name}.cxx)
target_link_libraries(${name} ${VTK_LIBRARIES} )
endforeach()
if(vtkTestingCore_LOADED)
foreach(name ${HYBRID_EXAMPLES_SRCS})
add_executable(${name} MACOSX_BUNDLE ${name}.cxx)
target_link_libraries(${name} ${VTK_LIBRARIES} )
endforeach()
endif()
......@@ -19,23 +19,25 @@ target_link_libraries(DumpXMLFile ${VTK_LIBRARIES})
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 ${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)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## 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 ${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()
endif()
......@@ -20,17 +20,19 @@ endif()
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)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(KIT ImageProcessingExamples)
set(MyTests TestImageSlicing.cxx)
include(vtkTestingObjectFactory)
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
include(vtkTestingObjectFactory)
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()
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-ImageSlicing COMMAND ${KIT}CxxTests
TestImageSlicing ${VTK_DATA_ROOT}/Data/headsq/quarter)
endif()
endif()
endif()
......@@ -39,24 +39,26 @@ add_executable(GenerateCubesFromLabels MACOSX_BUNDLE GenerateCubesFromLabels.cx
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 ${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)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## 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 ${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()
endif()
......@@ -26,26 +26,28 @@ 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 ${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)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## 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 ${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()
endif()
......@@ -19,5 +19,7 @@ if(NOT VTK_BINARY_DIR)
include(${VTK_USE_FILE})
endif()
add_executable(MultiBlock MACOSX_BUNDLE MultiBlock.cxx)
target_link_libraries(MultiBlock ${VTK_LIBRARIES})
if(vtkTestingCore_LOADED)
add_executable(MultiBlock MACOSX_BUNDLE MultiBlock.cxx)
target_link_libraries(MultiBlock ${VTK_LIBRARIES})
endif()
......@@ -30,7 +30,7 @@ foreach(name ${RENDERING_EXAMPLES_SRCS})
target_link_libraries(${name} ${VTK_LIBRARIES} )
endforeach()
if(VTK_SOURCE_DIR)
if(vtkTestingCore_LOADED)
include_directories(
# in support of SurfaceLICDemo that includes
# TestSurfaceLIC.h from the dir below
......
......@@ -24,31 +24,33 @@ target_link_libraries(TubesWithVaryingRadiusAndColors ${VTK_LIBRARIES})
target_link_libraries(FilledContours ${VTK_LIBRARIES})
target_link_libraries(BandedContours ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
set(KIT VisualizationAlgorithmsExamples)
set(MyTests
TestFilledContours.cxx
TestBandedContours.cxx
TestTubesWithVaryingRadiusAndColors.cxx
)
include(vtkTestingObjectFactory)
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
add_test(NAME ${KIT}-TubesWithVaryingRadiusAndColors
COMMAND ${KIT}CxxTests
TestTubesWithVaryingRadiusAndColors)
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-FilledContours
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(KIT VisualizationAlgorithmsExamples)
set(MyTests
TestFilledContours.cxx
TestBandedContours.cxx
TestTubesWithVaryingRadiusAndColors.cxx
)
include(vtkTestingObjectFactory)
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
add_test(NAME ${KIT}-TubesWithVaryingRadiusAndColors
COMMAND ${KIT}CxxTests
TestFilledContours
TestTubesWithVaryingRadiusAndColors)
if (VTK_DATA_ROOT)
add_test(NAME ${KIT}-FilledContours
COMMAND ${KIT}CxxTests
TestFilledContours
${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
add_test(NAME ${KIT}-BandedContours
COMMAND ${KIT}CxxTests
TestBandedContours
add_test(NAME ${KIT}-BandedContours
COMMAND ${KIT}CxxTests
TestBandedContours
${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
endif()
endif()
endif()
......@@ -26,17 +26,19 @@ target_link_libraries(Slider2D ${VTK_LIBRARIES})
add_executable(BalloonWidget MACOSX_BUNDLE BalloonWidget.cxx)
target_link_libraries(BalloonWidget ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
set(KIT WidgetsExamples)
set(MyTests TestSlider.cxx TestSlider2D.cxx TestBalloonWidget.cxx)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(KIT WidgetsExamples)
set(MyTests TestSlider.cxx TestSlider2D.cxx TestBalloonWidget.cxx)
include(vtkTestingObjectFactory)
include(vtkTestingObjectFactory)
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
add_executable(${KIT}CxxTests ${KIT}CxxTests.cxx ${MyTests})
target_link_libraries(${KIT}CxxTests ${VTK_LIBRARIES})
add_test(NAME ${KIT}-Slider COMMAND ${KIT}CxxTests TestSlider)
add_test(NAME ${KIT}-Slider2D COMMAND ${KIT}CxxTests TestSlider2D)
add_test(NAME ${KIT}-BalloonWidget COMMAND ${KIT}CxxTests TestBalloonWidget)
add_test(NAME ${KIT}-Slider COMMAND ${KIT}CxxTests TestSlider)
add_test(NAME ${KIT}-Slider2D COMMAND ${KIT}CxxTests TestSlider2D)
add_test(NAME ${KIT}-BalloonWidget COMMAND ${KIT}CxxTests TestBalloonWidget)
endif()
endif()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment