diff --git a/CMakeLists.txt b/CMakeLists.txt index f8dd75c6809372cf1d3b3285e6083f89de2f2dfd..1c679b1a77fc058220c045bbb7d65cfdff64e666 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,10 @@ set(CMAKE_CXX_STANDARD 11) message(STATUS "memory processing: GPU build in mode is ${INCLUDE_CUDA}") if(INCLUDE_CUDA) - enable_language(CUDA) - include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + if(NOT DEFINED CMAKE_CUDA_COMPILER) + enable_language(CUDA) + include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) + endif() # -DCMAKE_CUDA_ARCHITECTURES=native -- Compile for the architecture(s) of the host's GPU(s) endif(INCLUDE_CUDA)