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