Examples now call find_package(VTKm)

The examples are now written so they can be copied out of the vtk-m
source and still build properly. This will help new users / developers
learn how to build projects that use VTK-m.
This commit is contained in:
Robert Maynard 2016-08-22 13:18:36 -04:00
parent ce3c7f64b5
commit 88ce3f23ae
10 changed files with 59 additions and 29 deletions

@ -19,8 +19,9 @@
## this software.
##
##=============================================================================
#specify that all examples should be quiet in the detection of components
set(VTKm_CONFIGURE_QUIET TRUE)
#add the directory that contains the VTK-m config file to the cmake
#path so that our examples can find VTK-m
set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR})
add_subdirectory(clipping)
add_subdirectory(demo)

@ -19,6 +19,8 @@
## this software.
##
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()

@ -19,7 +19,18 @@
## this software.
##
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
#configure the OSMesa component
vtkm_configure_component_OSMESA()
if(VTKm_OSMesa_FOUND)
if(VTKm_CUDA_FOUND)
@ -30,8 +41,17 @@ if(VTKm_OSMesa_FOUND)
add_executable(Demo Demo.cxx)
endif()
#need to setup the default device adapter.
target_include_directories(Demo PRIVATE ${VTKm_INCLUDE_DIRS})
target_link_libraries(Demo ${VTKm_LIBRARIES})
target_compile_options(Demo PRIVATE ${VTKm_COMPILE_OPTIONS})
#when we are using TBB pass in the default device adapter as
#a compile definition to make sure we build with TBB selected
if(VTKm_TBB_FOUND)
target_compile_definitions( TARGET Demo
PRIVATGE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
endif()
endif()

@ -18,4 +18,7 @@
// this software.
//============================================================================
//Define the CUDA device adapter as being the default
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
#include "Demo.cxx"

@ -20,14 +20,20 @@
##
##=============================================================================
find_package(GLUT)
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Interop()
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
#configure the rendering / interop components
vtkm_configure_component_OpenGL()
vtkm_configure_component_Interop()
find_package(GLUT)
if(VTKm_Interop_FOUND AND VTKm_OpenGL_FOUND AND GLUT_FOUND)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(HelloWorld_SERIAL HelloWorld.cxx LoadShaders.h)

@ -20,13 +20,16 @@
##
##=============================================================================
find_package(GLUT)
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(GLUT)
if(VTKm_OpenGL_FOUND AND GLUT_FOUND)
add_executable(IsosurfaceUniformGrid_SERIAL IsosurfaceUniformGrid.cxx quaternion.h)
set_source_files_properties(quaternion.h PROPERTIES HEADER_FILE_ONLY TRUE)

@ -20,8 +20,10 @@
##
##=============================================================================
find_package(GLUT)
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()

@ -20,32 +20,17 @@
##
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
#vtkm_configure_component_CUDA()
#vtkm_configure_component_TBB()
find_package(GLUT)
if(VTKm_OpenGL_FOUND AND GLUT_FOUND)
add_executable(Rendering_SERIAL Rendering.cxx)
target_include_directories(Rendering_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${VTKm_INCLUDE_DIRS})
target_link_libraries(Rendering_SERIAL ${GLUT_LIBRARIES} ${VTKm_LIBRARIES})
target_compile_options(Rendering_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
# if(VTKm_CUDA_FOUND)
# vtkm_disable_troublesome_thrust_warnings()
# # Cuda compiles do not respect target_include_directories
# cuda_include_directories(${VTKm_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
# cuda_add_executable(Rendering_CUDA Rendering.cu)
# target_include_directories(Rendering_CUDA PRIVATE ${GLUT_INCLUDE_DIR} ${VTKm_INCLUDE_DIRS})
# target_link_libraries(Rendering_CUDA ${GLUT_LIBRARIES} ${VTKm_LIBRARIES})
# target_compile_options(Rendering_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
# endif()
# if(VTKm_TBB_FOUND)
# add_executable(Rendering_TBB IsosurfaceUniformGridTBB.cxx)
# target_include_directories(Rendering_TBB PRIVATE ${GLUT_INCLUDE_DIR} ${VTKm_INCLUDE_DIRS})
# target_link_libraries(Rendering_TBB ${GLUT_LIBRARIES} ${VTKm_LIBRARIES})
# target_compile_options(Rendering_TBB PRIVATE ${VTKm_COMPILE_OPTIONS})
# endif()
endif()

@ -20,13 +20,16 @@
##
##=============================================================================
find_package(GLUT)
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(GLUT)
if(VTKm_OpenGL_FOUND AND GLUT_FOUND)
add_executable(StreamLineUniformGrid_SERIAL StreamLineUniformGrid.cxx)
target_include_directories(StreamLineUniformGrid_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR})

@ -20,13 +20,18 @@
##
##=============================================================================
find_package(GLUT)
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(GLUT)
if(VTKm_OpenGL_FOUND AND GLUT_FOUND)
add_executable(TetrahedralizeExplicitGrid_SERIAL TetrahedralizeExplicitGrid.cxx)
target_include_directories(TetrahedralizeExplicitGrid_SERIAL PRIVATE ${GLUT_INCLUDE_DIR} ${VTKm_INCLUDE_DIRS})