diff options
author | Ray Molenkamp <github@lazydodo.com> | 2017-09-22 22:57:21 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2017-09-22 22:57:21 +0300 |
commit | 0e802fabb406e334a8cb1dad428e6fdac72ff7e5 (patch) | |
tree | c2e7d2ad928889bd8eb61b6bcf7cf94e10c9e786 /build_files/build_environment/cmake | |
parent | 925f2c8b9d2ac766d697e8b840e1715b67e6ceeb (diff) |
[cmake/deps_builder] update openjpeg to 1.5.2 to match the version in master/extern , add support for openjpeg in oiio. Mark webp as an optional component.
Diffstat (limited to 'build_files/build_environment/cmake')
4 files changed, 41 insertions, 8 deletions
diff --git a/build_files/build_environment/cmake/openimageio.cmake b/build_files/build_environment/cmake/openimageio.cmake index b36e883e93c..96b221388da 100644 --- a/build_files/build_environment/cmake/openimageio.cmake +++ b/build_files/build_environment/cmake/openimageio.cmake @@ -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() diff --git a/build_files/build_environment/cmake/openjpeg.cmake b/build_files/build_environment/cmake/openjpeg.cmake index 0183b11cf41..406badf31fe 100644 --- a/build_files/build_environment/cmake/openjpeg.cmake +++ b/build_files/build_environment/cmake/openjpeg.cmake @@ -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) diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index 78d6a11795f..9979a682614 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -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) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index df15dd65417..e53beeddf4a 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -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) |