Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to CMake policy CMP0146, FindCUDA.cmake removed #25

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)