Commit 3c68fe1f authored by Bill Lorensen's avatar Bill Lorensen

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.

Change-Id: I2035e49c7df4ba6f3d88447ea1b768ec63b87ee7
parent 32490cfe
......@@ -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,18 +19,20 @@ 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(vtk-example IOExamples)
if (VTK_DATA_ROOT)
set(TestDumpXMLFile_ARGS ${VTK_DATA_ROOT}/Data/cow.vtp)
set(TestParticleReader_ARGS
${VTK_DATA_ROOT}/Data/golf.csv
${VTK_TEST_OUTPUT_DIR}/TestParticleReader.vtp)
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestParticleReader.cxx
TestDumpXMLFile.cxx
)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example IOExamples)
if (VTK_DATA_ROOT)
set(TestDumpXMLFile_ARGS ${VTK_DATA_ROOT}/Data/cow.vtp)
set(TestParticleReader_ARGS
${VTK_DATA_ROOT}/Data/golf.csv
${VTK_TEST_OUTPUT_DIR}/TestParticleReader.vtp)
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestParticleReader.cxx
TestDumpXMLFile.cxx
)
endif()
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
endif()
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
endif()
......@@ -20,12 +20,14 @@ endif()
add_executable(ImageSlicing MACOSX_BUNDLE ImageSlicing.cxx)
target_link_libraries(ImageSlicing ${VTK_LIBRARIES})
if(vtkTestingRendering_SOURCE_DIR)
######## Regression Testing ########
set(vtk-example ImageProcessingExamples)
set(TestImageSlicing_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
vtk_add_test_cxx(
TestImageSlicing.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example ImageProcessingExamples)
set(TestImageSlicing_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
vtk_add_test_cxx(
TestImageSlicing.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
endif()
endif()
......@@ -39,18 +39,20 @@ 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(vtk-example MedicalExamples)
set(TestMedical1_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical2_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical3_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical4_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
vtk_add_test_cxx(
TestMedical1.cxx
TestMedical2.cxx
TestMedical3.cxx
TestMedical4.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example MedicalExamples)
set(TestMedical1_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical2_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical3_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
set(TestMedical4_ARGS ${VTK_DATA_ROOT}/Data/headsq/quarter)
vtk_add_test_cxx(
TestMedical1.cxx
TestMedical2.cxx
TestMedical3.cxx
TestMedical4.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
endif()
endif()
......@@ -26,24 +26,26 @@ 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(vtk-example ModellingExamples)
set(TestFinance_ARGS ${VTK_DATA_ROOT}/Data/financial.txt)
set(TestDelaunay3D_ARGS
${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3D.vtu
)
set(TestDelaunay3DAlpha_ARGS
.5 ${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3DAlpha.vtu
)
vtk_add_test_cxx(
TestFinance.cxx
)
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestDelaunay3D.cxx
TestDelaunay3DAlpha.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example ModellingExamples)
set(TestFinance_ARGS ${VTK_DATA_ROOT}/Data/financial.txt)
set(TestDelaunay3D_ARGS
${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3D.vtu
)
set(TestDelaunay3DAlpha_ARGS
.5 ${VTK_DATA_ROOT}/Data/cow.vtp
${VTK_TEST_OUTPUT_DIR}/Delaunay3DAlpha.vtu
)
vtk_add_test_cxx(
TestFinance.cxx
)
vtk_add_test_cxx(NO_DATA NO_VALID NO_OUTPUT
TestDelaunay3D.cxx
TestDelaunay3DAlpha.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
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,15 +24,17 @@ 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(vtk-example VisualizationAlgorithmsExamples)
set(TestFilledContours_ARGS ${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
set(TestBandedContours_ARGS ${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
vtk_add_test_cxx(
TestTubesWithVaryingRadiusAndColors.cxx
TestFilledContours.cxx
TestBandedContours.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example VisualizationAlgorithmsExamples)
set(TestFilledContours_ARGS ${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
set(TestBandedContours_ARGS ${VTK_DATA_ROOT}/Data/filledContours.vtp 10)
vtk_add_test_cxx(
TestTubesWithVaryingRadiusAndColors.cxx
TestFilledContours.cxx
TestBandedContours.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
endif()
endif()
......@@ -26,13 +26,15 @@ 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(vtk-example WidgetsExamples)
vtk_add_test_cxx(
TestSlider.cxx
TestSlider2D.cxx
TestBalloonWidget.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example WidgetsExamples)
vtk_add_test_cxx(
TestSlider.cxx
TestSlider2D.cxx
TestBalloonWidget.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests RENDERING_FACTORY)
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