From 619546beaa829d012b30cfb83dadd166f05a4cfa Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 15 Dec 2023 02:40:13 -0500 Subject: [PATCH] ENH: Add "Autoscoper-CUDA" external project and build it if CUDA Toolkit is found If SlicerAutoscoperM_CUDA_PATH env. variable is set, it is used to set the CUDA_PATH env. variable itself used by "find_package(CUDA)" to initialize the variable CUDA_TOOLKIT_ROOT_DIR passed to the "Autoscoper-CUDA" project. List of Autoscoper changes: $ git shortlog d476e2cbb..644473784 --no-merges Jean-Christophe Fillion-Robin (2): COMP: Update cutil headers to fix build against SDK without cufft library COMP: Ensure Autoscoper inner-build is built with expected CUDA toolkit --- SuperBuild.cmake | 13 +++++++++++++ SuperBuild/External_Autoscoper-CUDA.cmake | 3 +++ SuperBuild/External_Autoscoper.cmake | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 SuperBuild/External_Autoscoper-CUDA.cmake diff --git a/SuperBuild.cmake b/SuperBuild.cmake index aae55fc..17fbb45 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -21,6 +21,19 @@ set(${proj}_DEPENDS Autoscoper-OpenCL ) +if(DEFINED ENV{SlicerAutoscoperM_CUDA_PATH}) + set(ENV{CUDA_PATH} $ENV{SlicerAutoscoperM_CUDA_PATH}) +endif() + +find_package(CUDA) +if(CUDA_FOUND) + # Variable expected by find_package(CUDA) also used in Autoscoper + mark_as_superbuild(VARS CUDA_TOOLKIT_ROOT_DIR PROJECTS Autoscoper-CUDA) + list(APPEND ${proj}_DEPENDS + Autoscoper-CUDA + ) +endif() + ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj SUPERBUILD_VAR ${EXTENSION_NAME}_SUPERBUILD diff --git a/SuperBuild/External_Autoscoper-CUDA.cmake b/SuperBuild/External_Autoscoper-CUDA.cmake new file mode 100644 index 0000000..3055c2a --- /dev/null +++ b/SuperBuild/External_Autoscoper-CUDA.cmake @@ -0,0 +1,3 @@ +set(proj Autoscoper-CUDA) +set(${proj}_RENDERING_BACKEND CUDA) +include(${CMAKE_CURRENT_LIST_DIR}/External_Autoscoper.cmake) diff --git a/SuperBuild/External_Autoscoper.cmake b/SuperBuild/External_Autoscoper.cmake index 16e1b71..b96cd69 100644 --- a/SuperBuild/External_Autoscoper.cmake +++ b/SuperBuild/External_Autoscoper.cmake @@ -35,7 +35,7 @@ if(NOT DEFINED ${proj}_DIR AND NOT ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_SYSTEM_${p ExternalProject_SetIfNotDefined( Slicer_${proj}_GIT_TAG - "d476e2cbb4fc72a4dea5f4d467676bf9b978d8ce" + "644473784dd0018f5bf8518c5e5322092e4da07d" QUIET )