From 823765867063aeec0ac4703e047af13093526f5f Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 21 May 2021 15:56:37 -0400 Subject: [PATCH 1/2] FindThrust now guards against multiple inclusion by different consumers When multiple projects included via CPM depend on RMM we need to make sure that we only try to add target `thrust_internal`. --- cmake/install/FindThrust.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/install/FindThrust.cmake b/cmake/install/FindThrust.cmake index 23afa391a..e2a1026cd 100644 --- a/cmake/install/FindThrust.cmake +++ b/cmake/install/FindThrust.cmake @@ -56,9 +56,11 @@ if(Thrust_FOUND) # target since that'll use -isystem, leading to the wrong search order with nvcc function(thrust_create_target tgt) if(NOT TARGET ${tgt}) - add_library(thrust_internal INTERFACE) - set_target_properties(thrust_internal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${Thrust_INCLUDE_DIRS}") + if(NOT TARGET thrust_internal) + add_library(thrust_internal INTERFACE) + set_target_properties(thrust_internal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${Thrust_INCLUDE_DIRS}") + endif() add_library(${tgt} ALIAS thrust_internal) endif() endfunction() From 818202b14bbd30a3b6272284760e26e32171e061 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 21 May 2021 17:14:56 -0400 Subject: [PATCH 2/2] correct formatting --- cmake/install/FindThrust.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/install/FindThrust.cmake b/cmake/install/FindThrust.cmake index e2a1026cd..d44272417 100644 --- a/cmake/install/FindThrust.cmake +++ b/cmake/install/FindThrust.cmake @@ -60,7 +60,7 @@ if(Thrust_FOUND) add_library(thrust_internal INTERFACE) set_target_properties(thrust_internal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Thrust_INCLUDE_DIRS}") - endif() + endif() add_library(${tgt} ALIAS thrust_internal) endif() endfunction()