title: Cmake file for C++/CUDA project
body: <p>I'm having trouble compiling my application using <code>cmake</code> and <code>make</code>. The source files of the project are organized as follows:</p>
  
  <pre><code>SOURCE/
    CMakeLists.txt
    myApp.cc
    include/
      classA.hh
      classB.hh
    src/
      classA.cc
      classB.cc
      classB.cu 
  </code></pre>
  
  <p>My CMakeLists.txt file is as follows:</p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
  PROJECT(myApp)
  
  FIND_PACKAGE(VTK REQUIRED)
  INCLUDE(${VTK_USE_FILE})
  
  FIND_PACKAGE(GDCM REQUIRED)
  IF(GDCM_FOUND)
      INCLUDE(${GDCM_USE_FILE})
      SET(GDCM_LIBRARIES gdcmCommon vtkgdcm)
  ELSE(GDCM_FOUND)
      MESSAGE(FATAL_ERROR "Cannot find GDCM, did you set GDCM_DIR?")
  ENDIF(GDCM_FOUND)
  
  SET(CUDA_TOOLKIT_ROOT_DIR="/Developer/NVIDIA/CUDA-7.5/")
  FIND_PACKAGE(CUDA REQUIRED)
  SET(CUDA_PROPAGATE_HOST_FLAGS ON)
  SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -gencode arch=compute_30,code=sm_30)
  
  SET(LIB_TYPE SHARED)
  SET(CUDA_SEPARABLE_COMPILATION ON)
  
  LINK_DIRECTORIES(/lib/FFTW/INSTALL/lib)
  INCLUDE_DIRECTORIES(/lib/FFTW/INSTALL/include)
  
  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
  
  FILE(GLOB headers  ${PROJECT_SOURCE_DIR}/include/*.hh)
  FILE(GLOB sources  ${PROJECT_SOURCE_DIR}/src/*.cc)
  FILE(GLOB cudafile ${PROJECT_SOURCE_DIR}/src/*.cu)
  
  
  CUDA_ADD_EXECUTABLE(myApp myApp ${headers} ${sources} ${cudafile})
  TARGET_LINK_LIBRARIES(myApp ${VTK_LIBRARIES} ${GDCM_LIBRARIES} fftw3)
  </code></pre>
  
  <p>When I try to compile the project using make (after successfully running cmake) I get:</p>
  
  <pre><code>nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified
  CMake Error at myApp_generated_classB.cu.o.cmake:207 (message):
    Error generating
    ../BUILD/CMakeFiles/myApp.dir/src/./myApp_generated_classB.cu.o
  </code></pre>
  
  <p>Is breaking up the source file of a class into .cc and .cu files problematic?</p>