diff --git a/CMakeLists.txt b/CMakeLists.txt index f62eb3f3..8307b936 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16...3.25) +cmake_minimum_required(VERSION 3.16...3.29) include(cmake/RecordCmdLine.cmake) @@ -26,7 +26,7 @@ option(BUILD_VC "Build Vc library from source") include(CompilerSetup) if (CUDA) - include(CUDA) + enable_language(CUDA) endif() add_library(VecCore INTERFACE) diff --git a/cmake/CUDA.cmake b/cmake/CUDA.cmake deleted file mode 100644 index 5d23bdfb..00000000 --- a/cmake/CUDA.cmake +++ /dev/null @@ -1,3 +0,0 @@ -message(STATUS "Compiling with CUDA enabled") - -find_package(CUDA 8.0 REQUIRED) diff --git a/cmake/VecCoreConfig.cmake.in b/cmake/VecCoreConfig.cmake.in index 6aa308c5..27310a30 100644 --- a/cmake/VecCoreConfig.cmake.in +++ b/cmake/VecCoreConfig.cmake.in @@ -17,11 +17,13 @@ list(APPEND CMAKE_MODULE_PATH "${VecCore_CMAKE_DIR}") include(CMakeFindDependencyMacro) if (VecCore_FIND_COMPONENTS MATCHES "CUDA") - find_dependency(CUDA 7.5) - if(CUDA_FOUND) + include(CheckLanguage) + check_language(CUDA) + if(CMAKE_CUDA_COMPILER) + enable_language(CUDA) set(VecCore_CUDA_FOUND True) set(VecCore_CUDA_DEFINITIONS -DVECCORE_ENABLE_CUDA) - set(VecCore_CUDA_INCLUDE_DIR ${CUDA_INCLUDE_DIRS}) + set(VecCore_CUDA_INCLUDE_DIR ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) endif() endif() diff --git a/test/cuda/CMakeLists.txt b/test/cuda/CMakeLists.txt index 5b498920..0411b13f 100644 --- a/test/cuda/CMakeLists.txt +++ b/test/cuda/CMakeLists.txt @@ -1,3 +1,3 @@ -cuda_add_executable(hello hello.cu) +add_executable(hello hello.cu) target_link_libraries(hello VecCore) add_test(CUDAHelloWorld hello)