CMakeLists.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. set(INC
  2. ..
  3. ../../glew-mx
  4. )
  5. set(INC_SYS
  6. ${GLEW_INCLUDE_DIR}
  7. ../../../extern/clew/include
  8. )
  9. if(WITH_CUDA_DYNLOAD)
  10. list(APPEND INC
  11. ../../../extern/cuew/include
  12. )
  13. add_definitions(-DWITH_CUDA_DYNLOAD)
  14. else()
  15. list(APPEND INC_SYS
  16. ${CUDA_TOOLKIT_INCLUDE}
  17. )
  18. add_definitions(-DCYCLES_CUDA_NVCC_EXECUTABLE="${CUDA_NVCC_EXECUTABLE}")
  19. endif()
  20. set(SRC
  21. device.cpp
  22. device_cpu.cpp
  23. device_cuda.cpp
  24. device_denoising.cpp
  25. device_memory.cpp
  26. device_multi.cpp
  27. device_opencl.cpp
  28. device_split_kernel.cpp
  29. device_task.cpp
  30. )
  31. set(SRC_OPENCL
  32. opencl/opencl.h
  33. opencl/memory_manager.h
  34. opencl/opencl_split.cpp
  35. opencl/opencl_util.cpp
  36. opencl/memory_manager.cpp
  37. )
  38. if(WITH_CYCLES_NETWORK)
  39. list(APPEND SRC
  40. device_network.cpp
  41. )
  42. endif()
  43. set(SRC_HEADERS
  44. device.h
  45. device_denoising.h
  46. device_memory.h
  47. device_intern.h
  48. device_network.h
  49. device_split_kernel.h
  50. device_task.h
  51. )
  52. set(LIB
  53. )
  54. if(WITH_CUDA_DYNLOAD)
  55. list(APPEND LIB
  56. extern_cuew
  57. )
  58. else()
  59. list(APPEND LIB
  60. ${CUDA_CUDA_LIBRARY}
  61. )
  62. endif()
  63. add_definitions(${GL_DEFINITIONS})
  64. if(WITH_CYCLES_NETWORK)
  65. add_definitions(-DWITH_NETWORK)
  66. endif()
  67. if(WITH_CYCLES_DEVICE_OPENCL)
  68. list(APPEND LIB
  69. extern_clew
  70. )
  71. add_definitions(-DWITH_OPENCL)
  72. endif()
  73. if(WITH_CYCLES_DEVICE_CUDA)
  74. add_definitions(-DWITH_CUDA)
  75. endif()
  76. if(WITH_CYCLES_DEVICE_MULTI)
  77. add_definitions(-DWITH_MULTI)
  78. endif()
  79. include_directories(${INC})
  80. include_directories(SYSTEM ${INC_SYS})
  81. cycles_add_library(cycles_device "${LIB}" ${SRC} ${SRC_OPENCL} ${SRC_HEADERS})