096363e5d9fcbac01c88e854d515af8d268811d3
[blender.git] / intern / cycles / blender / CMakeLists.txt
1
2 SET(sources
3         blender_camera.cpp
4         blender_mesh.cpp
5         blender_object.cpp
6         blender_python.cpp
7         blender_session.cpp
8         blender_shader.cpp
9         blender_sync.cpp)
10
11 SET(headers
12         blender_sync.h
13         blender_session.h
14         blender_util.h)
15
16 SET(addonfiles
17         addon/__init__.py
18         addon/engine.py 
19         addon/enums.py
20         addon/properties.py
21         addon/ui.py
22         addon/xml.py)
23
24 INCLUDE_DIRECTORIES(
25         ../render
26         ../device
27         ../kernel
28         ../kernel/svm
29         ../util
30         ../subd
31         ${BLENDER_INCLUDE_DIRS}
32         ${PYTHON_INCLUDE_DIRS})
33
34 SET(LIBRARIES
35         cycles_render
36         cycles_bvh
37         cycles_device
38         cycles_kernel
39         cycles_util
40         cycles_subd
41         ${Boost_LIBRARIES}
42         ${OPENGL_LIBRARIES}
43         ${OPENIMAGEIO_LIBRARY}
44         ${PYTHON_LIBRARIES}
45         ${GLUT_LIBRARIES}
46         ${GLEW_LIBRARIES}
47         ${BLENDER_LIBRARIES})
48
49 IF(WITH_CYCLES_OSL)
50         LIST(APPEND LIBRARIES cycles_kernel_osl ${OSL_LIBRARIES})
51 ENDIF()
52
53 IF(WITH_CYCLES_PARTIO)
54         LIST(APPEND LIBRARIES ${PARTIO_LIBRARIES})
55 ENDIF()
56
57 IF(WITH_CYCLES_OPENCL)
58         LIST(APPEND LIBRARIES ${OPENCL_LIBRARIES})
59 ENDIF()
60
61 SET(CMAKE_MODULE_LINKER_FLAGS ${PYTHON_MODULE_FLAGS})
62
63 ADD_LIBRARY(cycles_blender MODULE ${sources} ${headers})
64 ADD_DEPENDENCIES(cycles_blender bf_rna)
65 TARGET_LINK_LIBRARIES(cycles_blender ${LIBRARIES})
66
67 INSTALL(FILES ${addonfiles} DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
68 INSTALL(TARGETS cycles_blender LIBRARY DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
69
70 IF(UNIX AND NOT APPLE)
71         SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib)
72 ENDIF()
73