2016-03-30 13:32:54 +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 QUIET REQUIRED
|
2016-09-14 19:29:04 +00:00
|
|
|
OPTIONAL_COMPONENTS Serial CUDA TBB OSMesa Rendering
|
2016-08-23 20:07:38 +00:00
|
|
|
)
|
2016-08-22 17:18:36 +00:00
|
|
|
|
2016-03-30 13:32:54 +00:00
|
|
|
|
2016-09-09 19:59:15 +00:00
|
|
|
if(VTKm_OSMesa_FOUND AND VTKm_Rendering_FOUND)
|
2016-06-20 23:08:11 +00:00
|
|
|
if(VTKm_CUDA_FOUND)
|
2016-06-22 18:53:23 +00:00
|
|
|
# Cuda compiles do not respect target_include_directories
|
|
|
|
cuda_include_directories(${VTKm_INCLUDE_DIRS})
|
2016-06-20 23:08:11 +00:00
|
|
|
cuda_add_executable(Demo Demo.cu)
|
|
|
|
else()
|
|
|
|
add_executable(Demo Demo.cxx)
|
|
|
|
endif()
|
2016-03-30 13:32:54 +00:00
|
|
|
|
2016-08-22 17:18:36 +00:00
|
|
|
|
|
|
|
#need to setup the default device adapter.
|
2016-06-20 23:08:11 +00:00
|
|
|
target_include_directories(Demo PRIVATE ${VTKm_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(Demo ${VTKm_LIBRARIES})
|
|
|
|
target_compile_options(Demo PRIVATE ${VTKm_COMPILE_OPTIONS})
|
2016-04-08 00:06:05 +00:00
|
|
|
|
2016-08-22 17:18:36 +00:00
|
|
|
#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)
|
2016-09-09 18:49:05 +00:00
|
|
|
target_compile_definitions(Demo
|
|
|
|
PRIVATE "VTKM_DEVICE_ADAPTER=VTKM_DEVICE_ADAPTER_TBB")
|
2016-08-22 17:18:36 +00:00
|
|
|
endif()
|
|
|
|
|
2016-04-08 00:06:05 +00:00
|
|
|
endif()
|