diff --git a/CMake/VTKmConfig.cmake.in b/CMake/VTKmConfig.cmake.in index 7d12dd3f9..ceba9d00f 100644 --- a/CMake/VTKmConfig.cmake.in +++ b/CMake/VTKmConfig.cmake.in @@ -98,6 +98,7 @@ endif() # EXPORT_PROPERTIES of the vtkm_cuda target if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR) set_target_properties(vtkm::cuda PROPERTIES cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@") + set_target_properties(vtkm::cuda PROPERTIES requires_static_builds TRUE) endif() # VTKm requires some CMake Find modules not included with CMake, so diff --git a/CMake/VTKmDeviceAdapters.cmake b/CMake/VTKmDeviceAdapters.cmake index b643d4086..09f74f47a 100644 --- a/CMake/VTKmDeviceAdapters.cmake +++ b/CMake/VTKmDeviceAdapters.cmake @@ -121,14 +121,18 @@ if(VTKm_ENABLE_CUDA) set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME vtkm::cuda) install(TARGETS vtkm_cuda EXPORT ${VTKm_EXPORT_NAME}) - # Reserve `INTERFACE_REQUIRES_STATIC_BUILDS` to potential work around issues + # Reserve `requires_static_builds` to potential work around issues # where VTK-m doesn't work when building shared as virtual functions fail # inside device code. We don't want to force BUILD_SHARED_LIBS to a specific # value as that could impact other projects that embed VTK-m. Instead what # we do is make sure that libraries built by vtkm_library() are static # if they use CUDA + # + # This needs to be lower-case for the property to be properly exported + # CMake 3.15 we can add `requires_static_builds` to the EXPORT_PROPERTIES + # target property to have this automatically exported for us set_target_properties(vtkm_cuda PROPERTIES - INTERFACE_REQUIRES_STATIC_BUILDS TRUE + requires_static_builds TRUE ) diff --git a/CMake/VTKmWrappers.cmake b/CMake/VTKmWrappers.cmake index 7bde0b241..a2feff61c 100644 --- a/CMake/VTKmWrappers.cmake +++ b/CMake/VTKmWrappers.cmake @@ -207,7 +207,7 @@ function(vtkm_add_target_information uses_vtkm_target) # dynamic library boundaries. if(TARGET vtkm::cuda) get_target_property(lib_type ${uses_vtkm_target} TYPE) - get_target_property(requires_static vtkm::cuda INTERFACE_REQUIRES_STATIC_BUILDS) + get_target_property(requires_static vtkm::cuda requires_static_builds) if(requires_static AND ${lib_type} STREQUAL "SHARED_LIBRARY" AND VTKm_TI_EXTENDS_VTKM) #We provide different error messages based on if we are building VTK-m