add compatibility with CMake 3.17

This commit is contained in:
Stefano Sinigardi 2020-05-23 15:48:13 +02:00
parent 91e6b8631b
commit 6a2e9ca1c6
1 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,13 @@ if(CMAKE_CUDA_COMPILER AND ENABLE_CUDA)
message(STATUS "Your setup supports half precision (it requires CC >= 7.0)") message(STATUS "Your setup supports half precision (it requires CC >= 7.0)")
endif() endif()
endif() endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.17")
if(BUILD_SHARED_LIBS)
set(CMAKE_CUDA_RUNTIME_LIBRARY "Shared")
else()
set(CMAKE_CUDA_RUNTIME_LIBRARY "Static")
endif()
endif()
else() else()
set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA support" FORCE) set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA support" FORCE)
endif() endif()