04894af6d6c4cbcf0f4fb979184d9a271898bc7d
[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_CUDA_DYNLOAD)
64         list(APPEND ALL_CYCLES_LIBRARIES extern_cuew)
65 else()
66         list(APPEND ALL_CYCLES_LIBRARIES ${CUDA_CUDA_LIBRARY})
67 endif()
68 if(NOT CYCLES_STANDALONE_REPOSITORY)
69         list(APPEND ALL_CYCLES_LIBRARIES bf_intern_glew_mx bf_intern_guardedalloc ${GLEW_LIBRARY})
70 endif()
71
72 list(APPEND ALL_CYCLES_LIBRARIES
73         ${BOOST_LIBRARIES}
74         ${PNG_LIBRARIES}
75         ${JPEG_LIBRARIES}
76         ${ZLIB_LIBRARIES}
77         ${TIFF_LIBRARY}
78         ${OPENIMAGEIO_LIBRARIES}
79         ${OPENEXR_LIBRARIES}
80 )
81
82 include_directories(${INC})
83
84 link_directories(${OPENIMAGEIO_LIBPATH}
85                  ${BOOST_LIBPATH}
86                  ${PNG_LIBPATH}
87                  ${JPEG_LIBPATH}
88                  ${ZLIB_LIBPATH}
89                  ${TIFF_LIBPATH}
90                  ${OPENEXR_LIBPATH}
91                  ${OPENCOLORIO_LIBPATH})
92
93 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
94 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
95
96 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES}")
97 CYCLES_TEST(util_aligned_malloc "cycles_util")
98 CYCLES_TEST(util_path "cycles_util;${BOOST_LIBRARIES};${OPENIMAGEIO_LIBRARIES}")
99 CYCLES_TEST(util_string "cycles_util;${BOOST_LIBRARIES}")
100 CYCLES_TEST(util_task "cycles_util;${BOOST_LIBRARIES}")