Cycles: first batch of windows build fixes, not quite there yet.
[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         ${GLEW_INCLUDE_PATH})
34
35 SET(LIBRARIES
36         cycles_render
37         cycles_bvh
38         cycles_device
39         cycles_kernel
40         cycles_util
41         cycles_subd
42         ${Boost_LIBRARIES}
43         ${OPENGL_LIBRARIES}
44         ${OPENIMAGEIO_LIBRARY}
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 LINK_DIRECTORIES(${PYTHON_LIBPATH})
62 SET(CMAKE_MODULE_LINKER_FLAGS ${PYTHON_MODULE_FLAGS})
63
64 ADD_LIBRARY(cycles_blender MODULE ${sources} ${headers})
65 ADD_DEPENDENCIES(cycles_blender bf_rna)
66
67 IF(WIN32)
68         TARGET_LINK_LIBRARIES(cycles_blender ${PYTHON_LINKFLAGS})
69         TARGET_LINK_LIBRARIES(cycles_blender debug ${PYTHON_LIBRARY}_d)
70         TARGET_LINK_LIBRARIES(cycles_blender optimized ${PYTHON_LIBRARY})
71
72         SET_TARGET_PROPERTIES(cycles_blender PROPERTIES PREFIX "lib")
73         SET_TARGET_PROPERTIES(cycles_blender PROPERTIES SUFFIX ".pyd")
74 ENDIF()
75
76 TARGET_LINK_LIBRARIES(cycles_blender ${LIBRARIES})
77
78 INSTALL(FILES ${addonfiles} DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
79 INSTALL(TARGETS cycles_blender LIBRARY DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
80
81 IF(UNIX AND NOT APPLE)
82         SET_TARGET_PROPERTIES(cycles_blender PROPERTIES INSTALL_RPATH $ORIGIN/lib)
83 ENDIF()
84
85 # Install DLL's
86
87 IF(WIN32)
88         FILE(GLOB OIIO_DLLS "${CYCLES_OIIO}/bin/*.dll")
89         FILE(GLOB BOOST_DLLS "${CYCLES_BOOST}/lib/*.dll")
90         INSTALL(FILES ${OIIO_DLLS} ${BOOST_DLLS}
91                 DESTINATION ${CYCLES_INSTALL_PATH}/cycles)
92 ENDIF()
93
94