[Cycles/MSVC/Testing] Fix broken test code.
[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_render
26         cycles_device
27         cycles_bvh
28         cycles_graph
29         cycles_subd
30         cycles_util
31         ${OPENIMAGEIO_LIBRARIES}
32 )
33 if(WITH_CYCLES_OSL)
34         list(APPEND ALL_CYCLES_LIBRARIES
35                 cycles_kernel_osl
36                 ${OSL_LIBRARIES}
37                 ${LLVM_LIBRARIES}
38         )
39 endif()
40 if(WITH_IMAGE_OPENJPEG AND NOT WITH_SYSTEM_OPENJPEG)
41         list(APPEND ALL_CYCLES_LIBRARIES
42                 extern_openjpeg
43         )
44 endif()
45 if(WITH_CYCLES_OPENSUBDIV)
46         add_definitions(-DWITH_OPENSUBDIV)
47         include_directories(
48                 SYSTEM
49                 ${OPENSUBDIV_INCLUDE_DIR}
50         )
51         list(APPEND ALL_CYCLES_LIBRARIES
52                 ${OPENSUBDIV_LIBRARIES}
53         )
54 endif()
55 list(APPEND ALL_CYCLES_LIBRARIES
56         ${BOOST_LIBRARIES}
57         ${PNG_LIBRARIES}
58         ${JPEG_LIBRARIES}
59         ${ZLIB_LIBRARIES}
60         ${TIFF_LIBRARY}
61         ${OPENIMAGEIO_LIBRARIES}
62         ${OPENEXR_LIBRARIES}
63 )
64
65 include_directories(${INC})
66
67 link_directories(${OPENIMAGEIO_LIBPATH}
68                  ${BOOST_LIBPATH}
69                  ${PNG_LIBPATH}
70                  ${JPEG_LIBPATH}
71                  ${ZLIB_LIBPATH}
72                  ${TIFF_LIBPATH}
73                  ${OPENEXR_LIBPATH})
74
75 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
76 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
77
78 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES}")
79 CYCLES_TEST(util_aligned_malloc "cycles_util")
80 CYCLES_TEST(util_path "cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
81 CYCLES_TEST(util_string "cycles_util;${BOOST_LIBRARIES}")
82 CYCLES_TEST(util_task "cycles_util;${BOOST_LIBRARIES}")