Correct syntax for static, since we invoke g++ as linker and we have to pass it to ld
[blender-staging.git] / intern / cycles / CMakeLists.txt
1
2 set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
3
4 # External Libraries
5
6 include(cmake/external_libs.cmake)
7
8 # Build Flags
9
10 set(GCC_WARNING_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-long-long")
11 set(GCC_OPTIM_FLAGS "-ffast-math -msse -msse2 -msse3 -mtune=native")
12
13 if(APPLE)
14         set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
15         set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
16 endif(APPLE)
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 "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
24                 set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
25         endif()
26 endif(WIN32)
27
28 if(UNIX AND NOT APPLE)
29         set(CMAKE_CXX_FLAGS "${GCC_WARNING_FLAGS} ${GCC_OPTIM_FLAGS}")
30         set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
31 endif(UNIX AND NOT APPLE)
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 add_definitions(-DWITH_OPENCL)
53 add_definitions(-DWITH_CUDA)
54 add_definitions(-DWITH_MULTI)
55
56 include_directories(
57         ${BOOST_INCLUDE_DIR}
58         ${OPENIMAGEIO_INCLUDE_DIRS}
59         ${OPENIMAGEIO_INCLUDE_DIRS}/OpenImageIO)
60
61 # Subdirectories
62
63 SET(WITH_CYCLES_BLENDER ON)
64
65 if(WITH_CYCLES_BLENDER)
66         add_subdirectory(blender)
67 endif(WITH_CYCLES_BLENDER)
68
69 add_subdirectory(app)
70 add_subdirectory(bvh)
71 add_subdirectory(device)
72 add_subdirectory(doc)
73 add_subdirectory(kernel)
74 add_subdirectory(render)
75 add_subdirectory(subd)
76 add_subdirectory(util)
77