2015-09-11 21:16:23 +00:00
|
|
|
##=============================================================================
|
|
|
|
##
|
|
|
|
## Copyright (c) Kitware, Inc.
|
|
|
|
## All rights reserved.
|
|
|
|
## See LICENSE.txt for details.
|
|
|
|
##
|
|
|
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
## PURPOSE. See the above copyright notice for more information.
|
|
|
|
##
|
|
|
|
## Copyright 2015 Sandia Corporation.
|
|
|
|
## Copyright 2015 UT-Battelle, LLC.
|
|
|
|
## Copyright 2015 Los Alamos National Security.
|
|
|
|
##
|
|
|
|
## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
|
|
|
## the U.S. Government retains certain rights in this software.
|
|
|
|
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
|
|
## Laboratory (LANL), the U.S. Government retains certain rights in
|
|
|
|
## this software.
|
|
|
|
##
|
|
|
|
##=============================================================================
|
2016-08-22 17:18:36 +00:00
|
|
|
#Find the VTK-m package
|
2016-08-23 20:07:38 +00:00
|
|
|
find_package(VTKm REQUIRED QUIET
|
2016-09-14 19:29:04 +00:00
|
|
|
OPTIONAL_COMPONENTS Serial CUDA TBB
|
2016-08-23 20:07:38 +00:00
|
|
|
)
|
2016-06-21 23:40:30 +00:00
|
|
|
|
2015-09-11 21:16:23 +00:00
|
|
|
add_executable(Clipping_SERIAL Clipping.cxx)
|
2016-06-21 23:40:30 +00:00
|
|
|
target_include_directories(Clipping_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(Clipping_SERIAL ${VTKm_LIBRARIES})
|
2016-01-25 15:57:04 +00:00
|
|
|
target_compile_options(Clipping_SERIAL PRIVATE ${VTKm_COMPILE_OPTIONS})
|
2016-08-03 17:18:34 +00:00
|
|
|
target_compile_definitions(Clipping_SERIAL PRIVATE
|
|
|
|
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_SERIAL")
|
2015-09-11 21:16:23 +00:00
|
|
|
|
2016-02-22 16:25:15 +00:00
|
|
|
if(VTKm_CUDA_FOUND)
|
2015-09-11 21:16:23 +00:00
|
|
|
set (cudaSource "${CMAKE_CURRENT_BINARY_DIR}/Clipping.cu")
|
|
|
|
configure_file(Clipping.cxx ${cudaSource} COPYONLY)
|
|
|
|
|
2016-07-15 14:31:36 +00:00
|
|
|
set(old_nvcc_flags ${CUDA_NVCC_FLAGS})
|
|
|
|
set(old_cxx_flags ${CMAKE_CXX_FLAGS})
|
|
|
|
vtkm_setup_nvcc_flags( old_nvcc_flags old_cxx_flags)
|
2015-09-21 14:00:33 +00:00
|
|
|
vtkm_disable_troublesome_thrust_warnings()
|
|
|
|
|
2016-06-22 18:53:23 +00:00
|
|
|
# Cuda compiles do not respect target_include_directories
|
|
|
|
cuda_include_directories(${VTKm_INCLUDE_DIRS})
|
|
|
|
|
2015-09-11 21:16:23 +00:00
|
|
|
cuda_add_executable(Clipping_CUDA ${cudaSource})
|
2016-06-21 23:40:30 +00:00
|
|
|
target_include_directories(Clipping_CUDA PRIVATE ${VTKm_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(Clipping_CUDA ${VTKm_LIBRARIES})
|
2016-01-25 15:57:04 +00:00
|
|
|
target_compile_options(Clipping_CUDA PRIVATE ${VTKm_COMPILE_OPTIONS})
|
2015-09-21 14:00:33 +00:00
|
|
|
|
2015-09-11 21:16:23 +00:00
|
|
|
set(CUDA_NVCC_FLAGS ${old_nvcc_flags})
|
2016-07-15 14:31:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS ${old_cxx_flags})
|
2015-09-11 21:16:23 +00:00
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2016-06-21 23:40:30 +00:00
|
|
|
if(VTKm_TBB_FOUND)
|
2015-09-11 21:16:23 +00:00
|
|
|
add_executable(Clipping_TBB Clipping.cxx)
|
2015-11-12 21:34:31 +00:00
|
|
|
target_include_directories(Clipping_TBB PRIVATE ${VTKm_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(Clipping_TBB ${VTKm_LIBRARIES})
|
2016-01-25 15:57:04 +00:00
|
|
|
target_compile_options(Clipping_TBB PRIVATE PRIVATE ${VTKm_COMPILE_OPTIONS})
|
2016-08-03 17:18:34 +00:00
|
|
|
target_compile_definitions(Clipping_TBB PRIVATE
|
|
|
|
"VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
|
2015-09-11 21:16:23 +00:00
|
|
|
endif()
|