How to tell cmake to compile .cu files with NVCC C++ instead of NVCC C? : I have 2 files that form a small CUDA library from my previous program (which works well, btw) written on C++. 

The header for this library is:

         #ifndef __cudaLU__
         #define __cudaLU__

         #include <assert.h>
         #include <cuda_runtime.h>
         #include <cusolverDn.h>
         #include <cusolverSp.h>
         #include <cusparse.h>
         #include <cuComplex.h>
         #include <stdlib.h>


         void denseLS(int dim,
                      std::complex<float> * A,
                      std::complex<float> * b );

         void sparseLS(int dim,
                        std::complex<float> *csrVal,
                        int *csrRowPtr,
                        int *csrColInd,
                        std::complex<float> *vecVal);

         #endif

And I want to use this library in my old-as-the-hills C program just by setting procedure in the head of my main.c file:

         extern void denseLS(int dim, float complex *A, float complex *b);

And it fails with a bunch of similar errors. Few of them are:

         ..NA/cudaLS.cu(115): error: namespace "std" has no member "complex"

         ..NA/cudaLS.cu(115): error: expected a ")"

         ..NA/cudaLS.cu(137): error: identifier "csrRowPtr" is undefined

         ..NA/cudaLS.cu(169): error: identifier "csrColInd" is undefined

         ..NA/cudaLS.cu(170): error: identifier "csrVal" is undefined

         ..NA/cudaLS.cu(171): error: identifier "vecVal" is undefined

I tried to make a change std::complex<float> -> float complex and nothing works. Still same errors (without std error, ofc).

The cmake instructions file

         cmake_minimum_required(VERSION 3.8)
         project(NA)

         set(CMAKE_C_STANDARD 11)



         find_package(GSL REQUIRED)
         find_package(CUDA REQUIRED)

         include_directories("${CUDA_INCLUDE_DIRS}")

         cuda_add_library(solvers STATIC
                 cudaLS.cu
                 cudaLS.h)

         target_link_libraries(solvers ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY} ${CUDA_cusolver_LIBRARY})
         target_compile_features(solvers PUBLIC cxx_std_11)
         set_target_properties( solvers
                 PROPERTIES CUDA_SEPARABLE_COMPILATION ON)


         add_executable(NA main.c)
         set_target_properties(NA PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
         target_link_libraries(NA PRIVATE GSL::gsl m solvers)

What am I doing wrong pals?
