From 644473784dd0018f5bf8518c5e5322092e4da07d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 15 Dec 2023 02:17:37 -0500 Subject: [PATCH] COMP: Ensure Autoscoper inner-build is built with expected CUDA toolkit If the main project has been configured specifying the variable CUDA_TOOLKIT_ROOT_DIR, this propagates the variable to the inner-build. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd4d03ed..f41b16f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,13 @@ if(UNIX AND NOT APPLE) message(STATUS "Setting OpenGL_GL_PREFERENCE to ${OpenGL_GL_PREFERENCE}") endif() +if(Autoscoper_RENDERING_BACKEND STREQUAL "CUDA") + # Variable expected by find_package(CUDA) + if(DEFINED CUDA_TOOLKIT_ROOT_DIR) + mark_as_superbuild(CUDA_TOOLKIT_ROOT_DIR:PATH) + endif() +endif() + if(Autoscoper_RENDERING_BACKEND STREQUAL "OpenCL") set(Autoscoper_OpenCL_MINIMUM_REQUIRED_VERSION "1.2.0") mark_as_superbuild(Autoscoper_OpenCL_MINIMUM_REQUIRED_VERSION:STRING)