build_environment: fix windows ilmbase/openexr support.
authorRay Molenkamp <github@lazydodo.com>
Mon, 13 Aug 2018 15:27:57 +0000 (09:27 -0600)
committerRay Molenkamp <github@lazydodo.com>
Mon, 13 Aug 2018 15:27:57 +0000 (09:27 -0600)
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.

build_files/build_environment/cmake/ilmbase.cmake
build_files/build_environment/cmake/openexr.cmake
build_files/build_environment/cmake/versions.cmake

index 4bc94aacdd7d3dbc33f5f196e3598ba3526a91e6..d03485b0a1e6a1cac1888cd52e8da6daba92c2b3 100644 (file)
 #
 # ***** 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
index 509ffa140c7faedd57ea7964cf73066d1cfc3d69..e7222478090d41ac8ed37a9ebb5f5c5c1e29ff2e 100644 (file)
 #
 # ***** 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
index cbd341748e8adee6bffcba5c343b3e4475876b49..447bf82bfb4aa1583777d23fb874d7cb18a26045 100644 (file)
@@ -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)