Commit 6de7d07d authored by Robert Maynard's avatar Robert Maynard
Browse files

VTK-m requires CMake 3.13 to compile CUDA

This is to resolve issues related to FindThreads and CUDA
compilation.
parent c80c1d09
......@@ -96,8 +96,8 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_CMAKE_MODULE_PATH})
if(VTKm_ENABLE_CUDA)
if (CMAKE_VERSION VERSION_LESS "3.9")
message(FATAL_ERROR "VTK-m with CUDA requires CMake 3.9+")
if (CMAKE_VERSION VERSION_LESS 3.13)
message(FATAL_ERROR "VTK-m with CUDA requires CMake 3.13+")
endif()
endif()
......
......@@ -107,7 +107,7 @@ if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm::openmp)
endif()
if(VTKm_ENABLE_CUDA)
cmake_minimum_required(VERSION 3.9...3.14 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13...3.14 FATAL_ERROR)
enable_language(CUDA)
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
......@@ -115,12 +115,6 @@ if(VTKm_ENABLE_CUDA)
message(FATAL_ERROR "VTK-m CUDA support requires version 9.2+")
endif()
#To work around https://gitlab.kitware.com/cmake/cmake/issues/17512
#we need to fix the CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES variable
if(${CMAKE_VERSION} VERSION_LESS 3.10 AND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)
list(APPEND CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES "${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
endif()
if (NOT TARGET vtkm_cuda OR NOT TARGET vtkm::cuda)
add_library(vtkm_cuda INTERFACE)
set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME vtkm::cuda)
......
......@@ -129,14 +129,7 @@ function(vtkm_unit_tests)
set_property(TARGET ${test_prog} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${VTKm_LIBRARY_OUTPUT_PATH})
set_property(TARGET ${test_prog} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH})
#Starting in CMake 3.13, cmake will properly drop duplicate libraries
#from the link line so this workaround can be dropped
if (CMAKE_VERSION VERSION_LESS 3.13 AND "vtkm_rendering" IN_LIST VTKm_UT_LIBRARIES)
list(REMOVE_ITEM VTKm_UT_LIBRARIES "vtkm_cont")
target_link_libraries(${test_prog} PRIVATE ${VTKm_UT_LIBRARIES})
else()
target_link_libraries(${test_prog} PRIVATE vtkm_cont ${VTKm_UT_LIBRARIES})
endif()
target_link_libraries(${test_prog} PRIVATE vtkm_cont ${VTKm_UT_LIBRARIES})
foreach(index RANGE per_device_command_line_arguments)
if(per_device_command_line_arguments STREQUAL "")
......
......@@ -63,9 +63,10 @@ VTK-m Requires:
+ XCode 5.0+
+ MSVC 2015+
+ [CMake](http://www.cmake.org/download/)
+ CMake 3.8+ (for any build)
+ CMake 3.9+ (for CUDA build or OpenMP build)
+ CMake 3.8+
+ CMake 3.9+ (for OpenMP support)
+ CMake 3.11+ (for Visual Studio generator)
+ CMake 3.13+ (for CUDA support)
Optional dependencies are:
......
Supports Markdown
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