CMakeLists.txt 560 B

1234567891011121314151617
  1. cmake_minimum_required(VERSION 3.7)
  2. project (CudaObjectLibrary CUDA CXX)
  3. #Goal for this example:
  4. #build a object files some with cuda and some without than
  5. #embed these into an executable
  6. add_library(CudaMixedObjectLib OBJECT static.cu static.cpp)
  7. add_executable(CudaObjectLibrary
  8. main.cpp
  9. $<TARGET_OBJECTS:CudaMixedObjectLib>)
  10. if(APPLE)
  11. # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
  12. set_property(TARGET CudaObjectLibrary PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
  13. endif()