[cmake/deps_builder] update openjpeg to 1.5.2 to match the version in master/extern...
authorRay Molenkamp <github@lazydodo.com>
Fri, 22 Sep 2017 19:57:21 +0000 (13:57 -0600)
committerRay Molenkamp <github@lazydodo.com>
Fri, 22 Sep 2017 19:57:21 +0000 (13:57 -0600)
build_files/build_environment/CMakeLists.txt
build_files/build_environment/cmake/openimageio.cmake
build_files/build_environment/cmake/openjpeg.cmake
build_files/build_environment/cmake/options.cmake
build_files/build_environment/cmake/versions.cmake
build_files/build_environment/patches/openimageio_staticexr.diff

index 45c065ec6aba18c7a9b73d08e8f765dd19ff561c..9f7eb3c2c505ee651e9e37196d7126b349dd3a32 100644 (file)
@@ -78,7 +78,9 @@ include(cmake/openvdb.cmake)
 include(cmake/python.cmake)
 include(cmake/python_site_packages.cmake)
 include(cmake/numpy.cmake)
-include(cmake/webp.cmake)
+if (WITH_WEBP)
+       include(cmake/webp.cmake)
+endif()
 if(WIN32)
        include(cmake/hidapi.cmake)
 endif()
@@ -94,6 +96,7 @@ else()
 endif()
 
 if(NOT WIN32 OR ENABLE_MINGW64)
+       include(cmake/openjpeg.cmake)
        if(BUILD_MODE STREQUAL Release)
                if(WIN32)
                        include(cmake/zlib_mingw.cmake)
@@ -107,7 +110,6 @@ if(NOT WIN32 OR ENABLE_MINGW64)
                include(cmake/schroedinger.cmake)
                include(cmake/x264.cmake)
                include(cmake/xvidcore.cmake)
-               include(cmake/openjpeg.cmake)
                include(cmake/faad.cmake)
                include(cmake/ffmpeg.cmake)
                include(cmake/fftw.cmake)
index b36e883e93c19e83a8fd1b60c2e1a7c3d569ebb9..96b221388da8efd8dca3f89b79c7fc6b40ad3af4 100644 (file)
@@ -32,12 +32,31 @@ endif()
 
 if(WIN32)
        set(PNG_LIBNAME libpng16_static${LIBEXT})
-       set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
+       set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
+       set(OPENJPEG_POSTFIX _msvc)
 else()
        set(PNG_LIBNAME libpng${LIBEXT})
        set(OIIO_SIMD_FLAGS)
 endif()
 
+if (WITH_WEBP)
+       set(WEBP_ARGS   -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
+                                       -DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} )
+       set(WEBP_DEP external_webp)
+endif() 
+
+if (MSVC)
+set(OPENJPEG_FLAGS -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
+                                  -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
+                                  -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
+                                  -DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
+   )
+else()
+set(OPENJPEG_FLAGS     -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
+                                       -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
+       )
+endif()
+
 set(OPENIMAGEIO_EXTRA_ARGS
        -DBUILDSTATIC=ON
        ${OPENIMAGEIO_LINKSTATIC}
@@ -78,8 +97,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
        -DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
        -DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
        -DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
-       -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_VERSION}
-       -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
+       ${OPENJPEG_FLAGS}
        -DOCIO_PATH=${LIBDIR}/opencolorio/
        -DOpenEXR_USE_STATIC_LIBS=On
        -DOPENEXR_HOME=${LIBDIR}/openexr/
@@ -93,8 +111,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
        -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
        -DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
        -DSTOP_ON_WARNING=OFF
-       -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-       -DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
+       ${WEBP_FLAGS}
        ${OIIO_SIMD_FLAGS}
 )
 
@@ -109,7 +126,7 @@ ExternalProject_Add(external_openimageio
        INSTALL_DIR ${LIBDIR}/openimageio
 )
 
-add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_webp external_opencolorio external_openjpeg)
+add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_opencolorio external_openjpeg${OPENJPEG_POSTFIX} ${WEBP_DEP})
 if(NOT WIN32)
        add_dependencies(external_openimageio external_opencolorio_extra)
 endif()
index 0183b11cf413a61b402a96e10eddba5d0f00abf0..406badf31feef1f501391eee70f0c019ff275d3b 100644 (file)
@@ -38,6 +38,19 @@ ExternalProject_Add(external_openjpeg
        INSTALL_DIR ${LIBDIR}/openjpeg
 )
 
+#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
+if (MSVC)
+       set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
+ExternalProject_Add(external_openjpeg_msvc
+       URL ${OPENJPEG_URI}
+       DOWNLOAD_DIR ${DOWNLOAD_DIR}
+       URL_HASH SHA256=${OPENJPEG_HASH}
+       PREFIX ${BUILD_DIR}/openjpeg_msvc
+       CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF 
+       INSTALL_DIR ${LIBDIR}/openjpeg_msvc
+)
+endif()
+
        set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
 if(MSVC)
        set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)
index 78d6a11795f9d61ac6605826f5c105f602f637ba..9979a6826145b3489adc6d7e491c5c31f512d93c 100644 (file)
@@ -19,6 +19,7 @@
 if(WIN32)
        option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
 endif()
+option(WITH_WEBP "Enable building of oiio with webp support" OFF)
 set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
 
 if(NOT BUILD_MODE)
index df15dd6541771ccb34fa0b7f881a27b386e5acd8..e53beeddf4a4773054f51937542cf58622f5a40a 100644 (file)
@@ -195,9 +195,11 @@ set(XVIDCORE_VERSION 1.3.4)
 set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
 set(XVIDCORE_HASH 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f)
 
-set(OPENJPEG_VERSION 1.5)
+#this has to be in sync with the version in blenders /extern folder
+set(OPENJPEG_VERSION 1.5.2)
+set(OPENJPEG_SHORT_VERSION 1.5)
 set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz)
-set(OPENJPEG_HASH 60662566595e02104c0f6d1052f8b1669624c646e62b6280d5fd5a66d4e92f8d)
+set(OPENJPEG_HASH 3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d)
 
 set(FAAD_VERSION 2-2.7)
 set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.bz2)
index 7e4eee04548cf2d557b6092b54184d1c62d79e76..e1f0f47305711df698ef08da61697e7dd9a216e6 100644 (file)
@@ -1,10 +1,11 @@
 --- CMakeLists.txt     2016-11-01 01:03:44 -0600
 +++ CMakeLists.txt     2016-12-01 09:20:12 -0700
-@@ -454,7 +454,6 @@
+@@ -454,7 +454,7 @@
      add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
      add_definitions (-D_SCL_SECURE_NO_WARNINGS)
      add_definitions (-DJAS_WIN_MSVC_BUILD)
 -    add_definitions (-DOPENEXR_DLL)
++    add_definitions (-DOPJ_STATIC)
      if (LINKSTATIC)
          add_definitions (-DBoost_USE_STATIC_LIBS=1)
      else ()