86fb6e49e33411a7bd9902d80433deddc0ca309b
[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 set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3 -mtune=native")
12
13 if(APPLE)
14         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
15         set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
16 endif()
17
18 if(WIN32)
19         if(MSVC)
20                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox /Ot /arch:SSE2 -D_CRT_SECURE_NO_WARNINGS /EHsc /fp:fast")
21                 set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
22         elseif(CMAKE_COMPILER_IS_GNUCC)
23                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
24                 set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
25         endif()
26 endif()
27
28 if(UNIX AND NOT APPLE)
29         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_OPTIM_FLAGS}")
30         set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
31 endif()
32
33 # Definitions and Includes
34
35 add_definitions(${BOOST_DEFINITIONS} ${OPENIMAGEIO_DEFINITIONS})
36
37 add_definitions(-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {)
38 add_definitions(-DCCL_NAMESPACE_END=})
39
40 if(WITH_CYCLES_NETWORK)
41   add_definitions(-DWITH_NETWORK)
42 endif()
43
44 if(WITH_CYCLES_OSL)
45   add_definitions(-DWITH_OSL)
46 endif()
47
48 if(WITH_CYCLES_PARTIO)
49   add_definitions(-DWITH_PARTIO)
50 endif()
51
52 if(WITH_CYCLES_CUDA_BINARIES)
53   add_definitions(-DWITH_CUDA_BINARIES)
54 endif()
55
56 add_definitions(-DWITH_OPENCL)
57 add_definitions(-DWITH_CUDA)
58 add_definitions(-DWITH_MULTI)
59
60 include_directories(
61         ${BOOST_INCLUDE_DIR}
62         ${OPENIMAGEIO_INCLUDE_DIRS}
63         ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO)
64
65 # Subdirectories
66
67 if(WITH_CYCLES_BLENDER)
68         add_subdirectory(blender)
69 endif(WITH_CYCLES_BLENDER)
70
71 add_subdirectory(app)
72 add_subdirectory(bvh)
73 add_subdirectory(device)
74 add_subdirectory(doc)
75 add_subdirectory(kernel)
76 add_subdirectory(render)
77 add_subdirectory(subd)
78 add_subdirectory(util)
79