Cleanup: Resolve clang tidy warning / error
[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   ${OPENVDB_LIBRARIES}
86 )
87
88 include_directories(${INC})
89
90 link_directories(
91   ${OPENIMAGEIO_LIBPATH}
92   ${BOOST_LIBPATH}
93   ${PNG_LIBPATH}
94   ${JPEG_LIBPATH}
95   ${ZLIB_LIBPATH}
96   ${TIFF_LIBPATH}
97   ${OPENEXR_LIBPATH}
98   ${OPENCOLORIO_LIBPATH}
99   ${OPENVDB_LIBPATH}
100 )
101
102 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
103 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
104
105 CYCLES_TEST(render_graph_finalize "${ALL_CYCLES_LIBRARIES};bf_intern_numaapi")
106 CYCLES_TEST(util_aligned_malloc "cycles_util")
107 CYCLES_TEST(util_path "cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
108 CYCLES_TEST(util_string "cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
109 CYCLES_TEST(util_task "cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES};bf_intern_numaapi")
110 CYCLES_TEST(util_time "cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
111 set_source_files_properties(util_avxf_avx_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
112 CYCLES_TEST(util_avxf_avx "cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
113 set_source_files_properties(util_avxf_avx2_test.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
114 CYCLES_TEST(util_avxf_avx2 "cycles_util;bf_intern_numaapi;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")
115 CYCLES_TEST(util_transform "cycles_util;${OPENIMAGEIO_LIBRARIES};${BOOST_LIBRARIES}")