Fix Cycles gtests build on macOS.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 24 Oct 2017 11:09:41 +0000 (13:09 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 24 Oct 2017 15:52:20 +0000 (17:52 +0200)
build_files/cmake/platform/platform_apple.cmake
intern/cycles/test/CMakeLists.txt

index a08f94e5ec0dd2097fbece8639b36000ba45eb31..fcdebbb74adb24a5d136043898c1a57287f4339f 100644 (file)
@@ -161,7 +161,7 @@ if(WITH_CODEC_FFMPEG)
        set(FFMPEG_LIBPATH ${FFMPEG}/lib)
 endif()
 
-if(WITH_OPENJPEG OR WITH_CODEC_FFMPEG)
+if(WITH_IMAGE_OPENJPEG OR WITH_CODEC_FFMPEG)
        # use openjpeg from libdir that is linked into ffmpeg
        set(OPENJPEG ${LIBDIR}/openjpeg)
        set(WITH_SYSTEM_OPENJPEG ON)
@@ -291,6 +291,7 @@ if(WITH_OPENIMAGEIO)
                ${JPEG_LIBRARIES}
                ${TIFF_LIBRARY}
                ${OPENEXR_LIBRARIES}
+               ${OPENJPEG_LIBRARIES}
                ${ZLIB_LIBRARIES}
        )
        set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${LIBDIR}/ffmpeg/lib/libwebp.a)
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)