diff --git a/CMake/VTKmConfig.cmake.in b/CMake/VTKmConfig.cmake.in index 07b373bdc..07b504c4b 100644 --- a/CMake/VTKmConfig.cmake.in +++ b/CMake/VTKmConfig.cmake.in @@ -91,6 +91,13 @@ if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "@VTKm_BINARY_DIR@") include(${VTKm_CONFIG_DIR}/VTKmTargets.cmake) endif() +# Once we can require CMake 3.15 for all cuda builds we can +# replace this with setting `cuda_architecture_flags` as part of the +# EXPORT_PROPERTIES of the vtkm_cuda target +if(VTKm_ENABLE_CUDA) + set_target_properties(vtkm::cuda PROPERTIES cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@") +endif() + # VTKm requires some CMake Find modules not included with CMake, so # include the CMake modules distributed with VTKm. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_CMAKE_MODULE_PATH}) diff --git a/CMake/VTKmDeviceAdapters.cmake b/CMake/VTKmDeviceAdapters.cmake index 8d3d795ee..b643d4086 100644 --- a/CMake/VTKmDeviceAdapters.cmake +++ b/CMake/VTKmDeviceAdapters.cmake @@ -247,7 +247,11 @@ if(VTKm_ENABLE_CUDA) string(REPLACE ";" " " arch_flags "${arch_flags}") set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${arch_flags}") - set_target_properties(vtkm_cuda PROPERTIES INTERFACE_CUDA_Architecture_Flags "${arch_flags}") + # This needs to be lower-case for the property to be properly exported + # CMake 3.15 we can add `cuda_architecture_flags` to the EXPORT_PROPERTIES + # target property to have this automatically exported for us + set_target_properties(vtkm_cuda PROPERTIES cuda_architecture_flags "${arch_flags}") + set(VTKm_CUDA_Architecture_Flags "${arch_flags}") endif() endif() diff --git a/CMake/VTKmWrappers.cmake b/CMake/VTKmWrappers.cmake index e3bac9871..cb845f164 100644 --- a/CMake/VTKmWrappers.cmake +++ b/CMake/VTKmWrappers.cmake @@ -130,7 +130,7 @@ function(vtkm_get_cuda_flags settings_var) if(TARGET vtkm::cuda) get_property(arch_flags TARGET vtkm::cuda - PROPERTY INTERFACE_CUDA_Architecture_Flags) + PROPERTY cuda_architecture_flags) set(${settings_var} "${${settings_var}} ${arch_flags}" PARENT_SCOPE) endif() endfunction()