From dfcd43bc4931afda727f698ca8e6b374f1b337ca Mon Sep 17 00:00:00 2001 From: Richard Musil Date: Thu, 19 Sep 2019 15:48:31 +0200 Subject: [PATCH] Added a check for CUDA before enabling it. --- test/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 40110215..c51b8374 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -237,8 +237,10 @@ endif () if (${CMAKE_VERSION} VERSION_LESS 3.15) find_package(CUDA 9.0) else () - enable_language(CUDA OPTIONAL) + include(CheckLanguage) + check_language(CUDA) if (CMAKE_CUDA_COMPILER) + enable_language(CUDA OPTIONAL) set (CUDA_FOUND TRUE) endif () endif ()