diff options
author | Ray Molenkamp <github@lazydodo.com> | 2018-08-13 18:27:57 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2018-08-13 18:27:57 +0300 |
commit | 887d6cb1ee45a3338558021d2afeb2f9b1a102ff (patch) | |
tree | 646eca035363af98df1df563c27e8ee554c70b0f | |
parent | 4fc2a43e52f121e771ce57d7437ee2bcd9309248 (diff) |
build_environment: fix windows ilmbase/openexr support.
seems like the openexr 2.3.0 release tarball has broken cmake support, latest from git works
we'll have to revisit this once they get a new release out.
-rw-r--r-- | build_files/build_environment/cmake/ilmbase.cmake | 52 | ||||
-rw-r--r-- | build_files/build_environment/cmake/openexr.cmake | 60 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 9 |
3 files changed, 76 insertions, 45 deletions
diff --git a/build_files/build_environment/cmake/ilmbase.cmake b/build_files/build_environment/cmake/ilmbase.cmake index 4bc94aacdd7..d03485b0a1e 100644 --- a/build_files/build_environment/cmake/ilmbase.cmake +++ b/build_files/build_environment/cmake/ilmbase.cmake @@ -16,24 +16,34 @@ # # ***** END GPL LICENSE BLOCK ***** -# commenting out, Ray will clean if needed. -# if(WIN32) -# set(ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") -# endif() - -set(ILMBASE_EXTRA_ARGS - --enable-static - --disable-shared - --enable-cxxstd=11 -) - -ExternalProject_Add(external_ilmbase - URL ${ILMBASE_URI} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH MD5=${ILMBASE_HASH} - PREFIX ${BUILD_DIR}/ilmbase - CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ilmbase ${ILMBASE_EXTRA_ARGS} - BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && make -j${MAKE_THREADS} - INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && make install - INSTALL_DIR ${LIBDIR}/openexr -) +if(WIN32) + set(ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") + set(ILMBASE_EXTRA_ARGS + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_CXX_STANDARD_LIBRARIES=${ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES} + ) + ExternalProject_Add(external_ilmbase + URL ${ILMBASE_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${ILMBASE_HASH} + PREFIX ${BUILD_DIR}/ilmbase + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ilmbase ${DEFAULT_CMAKE_FLAGS} ${ILMBASE_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/openexr + ) +else() + set(ILMBASE_EXTRA_ARGS + --enable-static + --disable-shared + --enable-cxxstd=11 + ) + ExternalProject_Add(external_ilmbase + URL ${ILMBASE_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${ILMBASE_HASH} + PREFIX ${BUILD_DIR}/ilmbase + CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ilmbase ${ILMBASE_EXTRA_ARGS} + BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && make -j${MAKE_THREADS} + INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ilmbase/src/external_ilmbase/ && make install + INSTALL_DIR ${LIBDIR}/openexr + ) +endif()
\ No newline at end of file diff --git a/build_files/build_environment/cmake/openexr.cmake b/build_files/build_environment/cmake/openexr.cmake index 509ffa140c7..e7222478090 100644 --- a/build_files/build_environment/cmake/openexr.cmake +++ b/build_files/build_environment/cmake/openexr.cmake @@ -16,29 +16,45 @@ # # ***** END GPL LICENSE BLOCK ***** -# commenting out, Ray will clean if needed. -# if(WIN32) -# set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") -# endif() +if(WIN32) + set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") + set(OPENEXR_EXTRA_ARGS + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_CXX_STANDARD_LIBRARIES=${OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES} + -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} + -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ + -DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase + -DOPENEXR_BUILD_STATIC=On + -DOPENEXR_BUILD_PYTHON_LIBS=Off + ) + ExternalProject_Add(external_openexr + URL ${OPENEXR_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${OPENEXR_HASH} + PREFIX ${BUILD_DIR}/openexr + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/openexr + ) +else() + set(OPENEXR_PKG_CONFIG_PATH ${LIBDIR}/zlib/share/pkgconfig) + set(OPENEXR_EXTRA_ARGS + --enable-static + --disable-shared + --enable-cxxstd=11 + --with-ilmbase-prefix=${LIBDIR}/ilmbase + ) -set(OPENEXR_PKG_CONFIG_PATH ${LIBDIR}/zlib/share/pkgconfig) -set(OPENEXR_EXTRA_ARGS - --enable-static - --disable-shared - --enable-cxxstd=11 - --with-ilmbase-prefix=${LIBDIR}/ilmbase - ) - -ExternalProject_Add(external_openexr - URL ${OPENEXR_URI} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH MD5=${OPENEXR_HASH} - PREFIX ${BUILD_DIR}/openexr - CONFIGURE_COMMAND ${CONFIGURE_ENV} && export PKG_CONFIG_PATH=${OPENEXR_PKG_CONFIG_PATH} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/openexr ${OPENEXR_EXTRA_ARGS} - BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && make -j${MAKE_THREADS} - INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && make install - INSTALL_DIR ${LIBDIR}/openexr -) + ExternalProject_Add(external_openexr + URL ${OPENEXR_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${OPENEXR_HASH} + PREFIX ${BUILD_DIR}/openexr + CONFIGURE_COMMAND ${CONFIGURE_ENV} && export PKG_CONFIG_PATH=${OPENEXR_PKG_CONFIG_PATH} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/openexr ${OPENEXR_EXTRA_ARGS} + BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && make -j${MAKE_THREADS} + INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openexr/src/external_openexr/ && make install + INSTALL_DIR ${LIBDIR}/openexr + ) +endif() add_dependencies( external_openexr diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index cbd341748e8..447bf82bfb4 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -50,8 +50,13 @@ set(ILMBASE_URI https://github.com/openexr/openexr/releases/download/v${ILMBASE_ set(ILMBASE_HASH 354bf86de3b930ab87ac63619d60c860) set(OPENEXR_VERSION 2.3.0) -set(OPENEXR_URI https://github.com/openexr/openexr/releases/download/v${OPENEXR_VERSION}/openexr-${OPENEXR_VERSION}.tar.gz) -set(OPENEXR_HASH a157e8a46596bc185f2472a5a4682174) +if (WIN32) #release 2.3.0 tarball has broken cmake support + set(OPENEXR_URI https://github.com/openexr/openexr/archive/0ac2ea34c8f3134148a5df4052e40f155b76f6fb.tar.gz) + set(OPENEXR_HASH ed159435d508240712fbaaa21d94bafb) +else() + set(OPENEXR_URI https://github.com/openexr/openexr/releases/download/v${OPENEXR_VERSION}/openexr-${OPENEXR_VERSION}.tar.gz) + set(OPENEXR_HASH a157e8a46596bc185f2472a5a4682174) +endif() set(FREETYPE_VERSION 2.9.1) set(FREETYPE_URI http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz) |