add BLI_strcpy_rlen, replace strcat, which was used in misleading way.
[blender.git] / intern / cycles / CMakeLists.txt
1
2 set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
3 set(WITH_CYCLES_BLENDER ON)
4
5 # External Libraries
6
7 include(cmake/external_libs.cmake)
8
9 # Build Flags
10
11 if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
12         set(WITH_CYCLES_OPTIMIZED_KERNEL ON)
13 endif()
14
15 if(WIN32 AND MSVC)
16         set(CYCLES_SSE2_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc")
17         set(CYCLES_SSE3_KERNEL_FLAGS "/arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /fp:fast /EHsc")
18         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast -D_CRT_SECURE_NO_WARNINGS /EHsc")
19 elseif(CMAKE_COMPILER_IS_GNUCC)
20         set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2 -mfpmath=sse")
21         set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mfpmath=sse")
22         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
23 endif()
24
25 # for OSL
26 if(WIN32 AND MSVC)
27         set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
28 elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
29         set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
30 endif()
31
32 # Definitions and Includes
33
34 add_definitions(${BOOST_DEFINITIONS} ${OPENIMAGEIO_DEFINITIONS})
35
36 add_definitions(-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {)
37 add_definitions(-DCCL_NAMESPACE_END=})
38
39 if(WITH_CYCLES_OPTIMIZED_KERNEL)
40         add_definitions(-DWITH_OPTIMIZED_KERNEL)
41 endif()
42
43 if(WITH_CYCLES_NETWORK)
44         add_definitions(-DWITH_NETWORK)
45 endif()
46
47 if(WITH_CYCLES_OSL)
48         add_definitions(-DWITH_OSL)
49         add_definitions(-DOSL_STATIC_LIBRARY)
50         include_directories(${OSL_INCLUDES})
51 endif()
52
53 add_definitions(-DWITH_OPENCL)
54 add_definitions(-DWITH_CUDA)
55 add_definitions(-DWITH_MULTI)
56
57 include_directories(
58         SYSTEM
59         ${BOOST_INCLUDE_DIR}
60         ${OPENIMAGEIO_INCLUDE_DIRS}
61         ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO
62         ${OPENEXR_INCLUDE_DIR})
63
64 # Subdirectories
65
66 if(WITH_CYCLES_BLENDER)
67         add_subdirectory(blender)
68 endif()
69
70 if(WITH_CYCLES_TEST OR WITH_CYCLES_NETWORK)
71         add_subdirectory(app)
72 endif()
73
74 add_subdirectory(bvh)
75 add_subdirectory(device)
76 add_subdirectory(doc)
77 add_subdirectory(kernel)
78 add_subdirectory(render)
79 add_subdirectory(subd)
80 add_subdirectory(util)
81