Cycles: Fix test compilation failure after recent refactor
[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_IMAGE_OPENJPEG AND NOT WITH_SYSTEM_OPENJPEG)
46         list(APPEND ALL_CYCLES_LIBRARIES
47                 extern_openjpeg
48         )
49 endif()
50 if(WITH_CYCLES_OPENSUBDIV)
51         add_definitions(-DWITH_OPENSUBDIV)
52         include_directories(
53                 SYSTEM
54                 ${OPENSUBDIV_INCLUDE_DIR}
55         )
56         list(APPEND ALL_CYCLES_LIBRARIES
57                 ${OPENSUBDIV_LIBRARIES}
58         )
59 endif()
60 if(WITH_CUDA_DYNLOAD)
61         list(APPEND ALL_CYCLES_LIBRARIES extern_cuew)
62 else()
63         list(APPEND ALL_CYCLES_LIBRARIES ${CUDA_CUDA_LIBRARY})
64 endif()
65 if(NOT CYCLES_STANDALONE_REPOSITORY)
66         list(APPEND ALL_CYCLES_LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc ${GLEW_LIBRARY})
67 endif()
68
69 list(APPEND ALL_CYCLES_LIBRARIES
70         ${BOOST_LIBRARIES}
71         ${PNG_LIBRARIES}
72         ${JPEG_LIBRARIES}
73         ${ZLIB_LIBRARIES}
74         ${TIFF_LIBRARY}
75         ${OPENIMAGEIO_LIBRARIES}
76         ${OPENEXR_LIBRARIES}
77 )
78
79 include_directories(${INC})
80
81 link_directories(${OPENIMAGEIO_LIBPATH}
82                  ${BOOST_LIBPATH}
83                  ${PNG_LIBPATH}
84                  ${JPEG_LIBPATH}
85                  ${ZLIB_LIBPATH}
86                  ${TIFF_LIBPATH}
87                  ${OPENEXR_LIBPATH})
88
89 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
90 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
91
92 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES}")
93 CYCLES_TEST(util_aligned_malloc "cycles_util")
94 CYCLES_TEST(util_path "cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
95 CYCLES_TEST(util_string "cycles_util;${BOOST_LIBRARIES}")
96 CYCLES_TEST(util_task "cycles_util;${BOOST_LIBRARIES}")