Commit 98f7e0fa authored by Ben Boeckel's avatar Ben Boeckel

examples: port to the new module system

parent 0307b01a
......@@ -31,7 +31,7 @@ set(ANDROID_NATIVE_API_LEVEL "21" CACHE STRING "Android Native API Level")
set(ANDROID_ARCH_ABI "armeabi" CACHE STRING "Target Android architecture/abi")
# find android
if (BUILD_EXAMPLES)
if (VTK_BUILD_EXAMPLES)
find_program(ANDROID_EXECUTABLE
NAMES android
DOC "The android command-line tool")
......@@ -95,7 +95,7 @@ set(android_cmake_flags
-DANT_EXECUTABLE:FILE=${ANT_EXECUTABLE}
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DVTK_BUILD_EXAMPLES:BOOL=${VTK_BUILD_EXAMPLES}
-DVTK_RENDERING_BACKEND:STRING=OpenGL2
-DVTK_Group_Rendering:BOOL=OFF
-DVTK_Group_StandAlone:BOOL=OFF
......
......@@ -134,7 +134,7 @@ mark_as_advanced(Module_${vtk-module})
set(ios_cmake_flags
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
-DVTK_BUILD_EXAMPLES:BOOL=${VTK_BUILD_EXAMPLES}
-DVTK_USE_64BIT_IDS:BOOL=OFF
-DVTK_Group_Rendering:BOOL=OFF
-DVTK_Group_StandAlone:BOOL=OFF
......
......@@ -66,7 +66,7 @@ include(vtkCompilerDynamicAnalysisFlags)
#-----------------------------------------------------------------------------
# Do we want examples built?
option(BUILD_EXAMPLES "Build VTK examples." OFF)
option(VTK_BUILD_EXAMPLES "Build VTK examples." OFF)
set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
......@@ -383,14 +383,15 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
@ONLY)
option(VTK_BUILD_EXAMPLES "Build VTK examples." OFF)
if (VTK_BUILD_EXAMPLES)
add_subdirectory(Examples)
endif ()
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(VTK_BUILD_DOCUMENTATION "Build the VTK documentation" OFF)
if(VTK_BUILD_DOCUMENTATION)
......
......@@ -43,7 +43,7 @@ To build VTK and these examples follow the steps below.
If you want OpenGL ES 3.0 support make sure to change the setting of
OPENGL_ES_VERSION to 3.0. Volume Rendering requires ES 3.0. Make sure to turn on
BUILD_EXAMPLES
VTK_BUILD_EXAMPLES
* configure and generate as usual
......
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
project(VTKExamples)
PROJECT(VTKExamples)
include_regular_expression("^.*$")
if(NOT VTK_BINARY_DIR)
find_package(VTK REQUIRED)
else()
set(VTK_DIR ${VTK_BINARY_DIR})
find_package(VTK REQUIRED)
endif()
if (VTK_BINARY_DIR)
function (add_example dir)
add_test(
NAME "VTKExample-${dir}"
COMMAND "${CMAKE_CTEST_COMMAND}"
--build-generator
"${CMAKE_GENERATOR}"
--build-and-test
"${CMAKE_CURRENT_SOURCE_DIR}/${dir}"
"${CMAKE_CURRENT_BINARY_DIR}/${dir}"
--build-options
"-DBUILD_TESTING=ON"
"-DVTK_DIR=${vtk_cmake_build_dir}"
--test-command
"${CMAKE_CTEST_COMMAND}"
-C $<CONFIGURATION>)
endfunction ()
else ()
macro (add_example dir)
add_subdirectory("${dir}")
endmacro ()
endif ()
if (ANDROID)
add_subdirectory(Android)
......
......@@ -38,7 +38,7 @@ path/to/VTK-iOS-build> ccmake -DVTK_IOS_BUILD=ON /path/to/VTK -G Ninja
```
In `ccmake`, set the following options:
```
BUILD_EXAMPLES = OFF
VTK_BUILD_EXAMPLES = OFF
BUILD_TESTING = OFF
CMAKE_BUILD_TYPE = Release
IOS_DEVICE_ARCHITECTURES = arm64;armv7
......
......@@ -27,8 +27,8 @@ ConfigSummary = {
"BUILD_TESTING":
"@BUILD_TESTING@",
"BUILD_EXAMPLES":
"@BUILD_EXAMPLES@",
"VTK_BUILD_EXAMPLES":
"@VTK_BUILD_EXAMPLES@",
"VTK_DEBUG_LEAKS":
"@VTK_DEBUG_LEAKS@",
......
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