2023-08-15 14:20:26 +00:00
|
|
|
# SPDX-FileCopyrightText: 2022 Blender Authors
|
2023-06-14 12:49:59 +00:00
|
|
|
#
|
2022-04-19 16:08:51 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
set(IMATH_EXTRA_ARGS
|
2022-12-05 22:18:54 +00:00
|
|
|
-DBUILD_SHARED_LIBS=ON
|
2022-04-19 16:08:51 +00:00
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DIMATH_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
|
|
|
|
)
|
|
|
|
|
|
|
|
ExternalProject_Add(external_imath
|
|
|
|
URL file://${PACKAGE_DIR}/${IMATH_FILE}
|
|
|
|
DOWNLOAD_DIR ${DOWNLOAD_DIR}
|
|
|
|
URL_HASH ${IMATH_HASH_TYPE}=${IMATH_HASH}
|
|
|
|
PREFIX ${BUILD_DIR}/imath
|
2022-12-05 22:18:54 +00:00
|
|
|
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
|
2022-04-19 16:08:51 +00:00
|
|
|
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/imath ${DEFAULT_CMAKE_FLAGS} ${IMATH_EXTRA_ARGS}
|
|
|
|
INSTALL_DIR ${LIBDIR}/imath
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
ExternalProject_Add_Step(external_imath after_install
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/lib ${HARVEST_TARGET}/imath/lib
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/include ${HARVEST_TARGET}/imath/include
|
2022-12-05 22:18:54 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll
|
2022-04-19 16:08:51 +00:00
|
|
|
DEPENDEES install
|
|
|
|
)
|
|
|
|
endif()
|