CMakeLists.txt 716 B

1234567891011121314151617181920
  1. cmake_minimum_required(VERSION 3.7)
  2. project (CudaObjectLibrary CUDA CXX)
  3. #Goal for this example:
  4. #
  5. #Build C++ and CUDA object files and than use them to make an executable
  6. #Make sure that CMake logic to handle object output when multiple files
  7. #with the same name works
  8. add_subdirectory(Conflicts)
  9. add_library(CudaMixedObjectLib OBJECT static.cu static.cpp)
  10. add_executable(CudaObjectLibrary
  11. main.cpp
  12. $<TARGET_OBJECTS:CudaMixedObjectLib>
  13. $<TARGET_OBJECTS:CudaConflicts>)
  14. if(APPLE)
  15. # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
  16. set_property(TARGET CudaObjectLibrary PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
  17. endif()