CUDA with visual studio and cmake

I work with CUDA 8.0 and Visual Studio 2013. So far I have created VS solutions with CMake and it works very well. Typically, a cuda project is created with the following code snippet:

FIND_PACKAGE(CUDA REQUIRED)
INCLUDE_DIRECTORIES( ${CUDA_INCLUDE_DIRS})
link_directories(${CUDA_INCLUDE_DIRS}/../lib/x64)

The CUDA project works, compiles and works without problems. But I do not see the CUDA C / C ++ field in the project properties. When I create a VS solution directly in VS, I can select NVIDIA / CUDA 8.0 and the properties there (as you can see in the picture below) enter image description here

Question: My question is: is it possible to create a project using CMake and with the project parameter of the CUDA properties?

Thank you and I hope my question is clear.

+4
source share
1 answer

, ... CMake CUDA 3.8.

, CUDA (doku):

enable_language(CUDA) 

CMake CUDA- cmake add_executable add_library find_package(CUDA) cuda_add_executable().

CMake 3.8 Visual Studio IDE - 3.9 (Hooray!!). VS.

: CUDA Visual Studio, CMake 3.9 .

+1

Source: https://habr.com/ru/post/1667018/


All Articles