Merge branch 'blender2.7'
[blender.git] / intern / cycles / test / CMakeLists.txt
1 if(WITH_GTESTS)
2         Include(GTestTesting)
3
4         # Otherwise we get warnings here that we cant fix in external projects
5         remove_strict_flags()
6 endif()
7
8 macro(CYCLES_TEST SRC EXTRA_LIBS)
9         if(WITH_GTESTS)
10                 BLENDER_SRC_GTEST("cycles_${SRC}" "${SRC}_test.cpp" "${EXTRA_LIBS}")
11         endif()
12 endmacro()
13
14 set(INC
15         .
16         ..
17         ../device
18         ../graph
19         ../kernel
20         ../render
21         ../util
22 )
23
24 set(ALL_CYCLES_LIBRARIES
25         cycles_device
26         cycles_kernel
27         cycles_render
28         cycles_bvh
29         cycles_graph
30         cycles_subd
31         cycles_util
32         extern_clew
33         ${BLENDER_GL_LIBRARIES}
34         ${BLENDER_GLEW_LIBRARIES}
35         ${CYCLES_APP_GLEW_LIBRARY}
36         ${OPENIMAGEIO_LIBRARIES}
37 )
38 if(WITH_CYCLES_OSL)
39         list(APPEND ALL_CYCLES_LIBRARIES
40                 cycles_kernel_osl
41                 ${OSL_LIBRARIES}
42                 ${LLVM_LIBRARIES}
43         )
44 endif()
45 if(WITH_OPENCOLORIO)
46         list(APPEND ALL_CYCLES_LIBRARIES
47                 ${OPENCOLORIO_LIBRARIES}
48         )
49 endif()
50 if(WITH_IMAGE_OPENJPEG)
51         list(APPEND ALL_CYCLES_LIBRARIES ${OPENJPEG_LIBRARIES})
52 endif()
53 if(WITH_OPENSUBDIV)
54         add_definitions(-DWITH_OPENSUBDIV)
55         include_directories(
56                 SYSTEM
57                 ${OPENSUBDIV_INCLUDE_DIR}
58         )
59         list(APPEND ALL_CYCLES_LIBRARIES
60                 ${OPENSUBDIV_LIBRARIES}
61         )
62 endif()
63 if(WITH_CYCLES_EMBREE)
64         list(APPEND ALL_CYCLES_LIBRARIES
65                 ${EMBREE_LIBRARIES}
66         )
67 endif()
68 if(WITH_CUDA_DYNLOAD)
69         list(APPEND ALL_CYCLES_LIBRARIES extern_cuew)
70 else()
71         list(APPEND ALL_CYCLES_LIBRARIES ${CUDA_CUDA_LIBRARY})
72 endif()
73 if(NOT CYCLES_STANDALONE_REPOSITORY)
74         list(APPEND ALL_CYCLES_LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc ${GLEW_LIBRARY})
75 endif()
76
77 list(APPEND ALL_CYCLES_LIBRARIES
78         ${BOOST_LIBRARIES}
79         ${PNG_LIBRARIES}
80         ${JPEG_LIBRARIES}
81         ${ZLIB_LIBRARIES}
82         ${TIFF_LIBRARY}
83         ${OPENIMAGEIO_LIBRARIES}
84         ${OPENEXR_LIBRARIES}
85 )
86
87 include_directories(${INC})
88
89 link_directories(${OPENIMAGEIO_LIBPATH}
90                  ${BOOST_LIBPATH}
91                  ${PNG_LIBPATH}
92                  ${JPEG_LIBPATH}
93                  ${ZLIB_LIBPATH}
94                  ${TIFF_LIBPATH}
95                  ${OPENEXR_LIBPATH}
96                  ${OPENCOLORIO_LIBPATH})
97
98 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
99 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
100
101 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES};bf_intern_numaapi")
102 CYCLES_TEST(util_aligned_malloc "cycles_util")
103 CYCLES_TEST(util_path "cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
104 CYCLES_TEST(util_string "cycles_util;${BOOST_LIBRARIES}")
105 CYCLES_TEST(util_task "cycles_util;${BOOST_LIBRARIES};bf_intern_numaapi")