Skip to content

Commit

Permalink
Adapt to CMake policy CMP0146, FindCUDA.cmake removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilherme Lima authored and amadio committed Apr 8, 2024
1 parent 6b3e574 commit 743566f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16...3.25)
cmake_minimum_required(VERSION 3.16...3.29)

include(cmake/RecordCmdLine.cmake)

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions cmake/CUDA.cmake

This file was deleted.

8 changes: 5 additions & 3 deletions cmake/VecCoreConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion test/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cuda_add_executable(hello hello.cu)
add_executable(hello hello.cu)
target_link_libraries(hello VecCore)
add_test(CUDAHelloWorld hello)

0 comments on commit 743566f

Please sign in to comment.