build_environment: openexr support debug build.
authorRay Molenkamp <github@lazydodo.com>
Mon, 13 Aug 2018 18:37:12 +0000 (12:37 -0600)
committerRay Molenkamp <github@lazydodo.com>
Mon, 13 Aug 2018 18:37:12 +0000 (12:37 -0600)
build_files/build_environment/cmake/harvest.cmake
build_files/build_environment/cmake/ilmbase.cmake
build_files/build_environment/cmake/openexr.cmake
build_files/build_environment/cmake/options.cmake

index 4040f97df92bf2e9e1e6ce6b3b917cdf4a88b61d..49f444cb3904e309d272e1dd0284e9aa7d4f2966 100644 (file)
@@ -42,10 +42,6 @@ if(BUILD_MODE STREQUAL Release)
                                ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
                                ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
-                               # openEXR
-                               ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ilmbase ${HARVEST_TARGET}/openexr &&
-                               ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib &&
-                               ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include &&
                                # png
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
                                ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
@@ -98,14 +94,6 @@ if(BUILD_MODE STREQUAL Debug)
                                # OpenImageIO
                COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
-                               # ilmbase+openexr
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Half.lib ${HARVEST_TARGET}/openexr/lib/Half_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Iex-2_2.lib ${HARVEST_TARGET}/openexr/lib/Iex-2_2_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IexMath-2_2.lib ${HARVEST_TARGET}/openexr/lib/IexMath-2_2_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/IlmThread-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmThread-2_2_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/ilmbase/lib/Imath-2_2.lib ${HARVEST_TARGET}/openexr/lib/Imath-2_2_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImf-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImf-2_2_d.lib &&
-                               ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/lib/IlmImfUtil-2_2.lib ${HARVEST_TARGET}/openexr/lib/IlmImfUtil-2_2_d.lib &&
                                # opencollada
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib &&
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib &&
index d03485b0a1e6a1cac1888cd52e8da6daba92c2b3..4863cc6865a8ffcac734c88a0b3aadb8b30ab00b 100644 (file)
@@ -22,6 +22,7 @@ if(WIN32)
                -DBUILD_SHARED_LIBS=OFF
                -DCMAKE_CXX_STANDARD_LIBRARIES=${ILMBASE_CMAKE_CXX_STANDARD_LIBRARIES}
        )
+
        ExternalProject_Add(external_ilmbase
                URL ${ILMBASE_URI}
                DOWNLOAD_DIR ${DOWNLOAD_DIR}
@@ -30,6 +31,14 @@ if(WIN32)
                CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ilmbase ${DEFAULT_CMAKE_FLAGS} ${ILMBASE_EXTRA_ARGS}
                INSTALL_DIR ${LIBDIR}/openexr
        )
+
+       if(BUILD_MODE STREQUAL Release)
+               ExternalProject_Add_Step(external_ilmbase after_install
+                       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/ilmbase ${HARVEST_TARGET}/openexr
+                       DEPENDEES install
+               )
+       endif()
+
 else()
        set(ILMBASE_EXTRA_ARGS
                --enable-static
index 6c17f3ed580e879cad54127e320660cb33d3dd65..2aa167a4be5c8eac3026c73b95f9ebef5054b0bd 100644 (file)
@@ -23,9 +23,14 @@ if(WIN32)
                -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
                -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
                -DILMBASE_PACKAGE_PREFIX=${LIBDIR}/ilmbase
+               -DOPENEXR_BUILD_ILMBASE=On
+               -DOPENEXR_BUILD_OPENEXR=On
+               -DOPENEXR_BUILD_PYTHON_LIBS=Off
                -DOPENEXR_BUILD_STATIC=On
                -DOPENEXR_BUILD_SHARED=Off
-               -DOPENEXR_BUILD_PYTHON_LIBS=Off
+               -DOPENEXR_BUILD_TESTS=Off
+               -DOPENEXR_BUILD_VIEWERS=Off
+               -DOPENEXR_BUILD_UTILS=Off
        )
        ExternalProject_Add(external_openexr
                URL ${OPENEXR_URI}
@@ -35,6 +40,13 @@ if(WIN32)
                CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
                INSTALL_DIR ${LIBDIR}/openexr
        )
+       
+       ExternalProject_Add_Step(external_openexr after_install
+               COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib
+               COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include 
+               DEPENDEES install
+       )
+       
 else()
        set(OPENEXR_PKG_CONFIG_PATH ${LIBDIR}/zlib/share/pkgconfig)
        set(OPENEXR_EXTRA_ARGS
index c4dcf212e683b89e1aab192d0c92a849149eff79..b8efb1bda95c4d2c5dc5148548bdc35cf5fb8b5e 100644 (file)
@@ -202,7 +202,11 @@ endif()
 
 
 if(WIN32)
-       set(ZLIB_LIBRARY zlibstatic${LIBEXT})
+       if(BUILD_MODE STREQUAL Debug)
+               set(ZLIB_LIBRARY zlibstaticd${LIBEXT})
+       else()
+               set(ZLIB_LIBRARY zlibstatic${LIBEXT})
+       endif()
 else()
        set(ZLIB_LIBRARY libz${LIBEXT})
 endif()