Fix Cycles gtests build on macOS.
[blender.git] / intern / cycles / test / CMakeLists.txt
index f4213c508fc3ef50556d5f14c1ea669b85be7d60..f3e49dc0c4e2e29272acf656ae764445dd42d08f 100644 (file)
@@ -42,10 +42,12 @@ if(WITH_CYCLES_OSL)
                ${LLVM_LIBRARIES}
        )
 endif()
-if(WITH_IMAGE_OPENJPEG AND NOT WITH_SYSTEM_OPENJPEG)
-       list(APPEND ALL_CYCLES_LIBRARIES
-               extern_openjpeg
-       )
+if(WITH_IMAGE_OPENJPEG)
+       if(WITH_SYSTEM_OPENJPEG)
+               list(APPEND ALL_CYCLES_LIBRARIES ${OPENJPEG_LIBRARIES})
+       else()
+               list(APPEND ALL_CYCLES_LIBRARIES extern_openjpeg)
+       endif()
 endif()
 if(WITH_CYCLES_OPENSUBDIV)
        add_definitions(-DWITH_OPENSUBDIV)