diff --git a/Scripts/cmake/o3de_package_utilities.cmake b/Scripts/cmake/o3de_package_utilities.cmake index 80d42e55..759ac8e5 100644 --- a/Scripts/cmake/o3de_package_utilities.cmake +++ b/Scripts/cmake/o3de_package_utilities.cmake @@ -129,6 +129,10 @@ macro(o3de_import_existing_config_files package_name search_dir) # for other platforms, we set the xxxx_ROOT value. set(_old_find_root_path ${CMAKE_FIND_ROOT_PATH}) set(CMAKE_FIND_ROOT_PATH ${search_dir} ${CMAKE_FIND_ROOT_PATH}) + + set(_old_ignore_prefix_path ${CMAKE_IGNORE_PREFIX_PATH}) + set(CMAKE_IGNORE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR}) + set(${package_name}_ROOT ${search_dir}) # its also possible that an older version of _DIR has been cached. unset(${package_name}_DIR CACHE) @@ -136,6 +140,11 @@ macro(o3de_import_existing_config_files package_name search_dir) find_package(${package_name} CONFIG REQUIRED) # reset these variables back to what they were. set(CMAKE_FIND_ROOT_PATH ${_old_find_root_path}) + if (_old_ignore_prefix_path) + set(CMAKE_IGNORE_PREFIX_PATH ${_old_ignore_prefix_path}) + else() + unset(CMAKE_IGNORE_PREFIX_PATH) + endif() if (NOT ${package_name}_FOUND) message(FATAL_ERROR "Could not import configs for ${package_name} from ${search_dir}") endif() diff --git a/Scripts/extras/pull_and_build_from_git.py b/Scripts/extras/pull_and_build_from_git.py index 8fbd7053..996e2fc8 100644 --- a/Scripts/extras/pull_and_build_from_git.py +++ b/Scripts/extras/pull_and_build_from_git.py @@ -635,17 +635,27 @@ def sync_source(self): if len(call_result.stdout.decode('utf-8', 'ignore')): # If anything changed, then restore the entire source tree print(f"Path '{self.src_folder}' was modified. Restoring...") - git_restore_cmd = ['git', 'restore', '--recurse-submodules', ':/'] - call_result = subprocess.run(subp_args(git_restore_cmd), - shell=True, - capture_output=False, - cwd=str(self.src_folder.resolve())) + git_clean_command = ['git', 'clean', '-fd'] + call_result = subprocess.run(subp_args(git_clean_command), + shell=True, + capture_output=False, + cwd=str(self.src_folder.resolve())) if call_result.returncode != 0: # If we cannot restore through git, then delete the folder and re-clone - print(f"Unable to restore {self.src_folder}. Deleting and re-cloning...") + print(f"Unable to clean {self.src_folder}. Deleting and re-cloning...") delete_folder(self.src_folder) self.clone_to_local() - + else: + git_restore_cmd = ['git', 'restore', '--recurse-submodules', ':/'] + call_result = subprocess.run(subp_args(git_restore_cmd), + shell=True, + capture_output=False, + cwd=str(self.src_folder.resolve())) + if call_result.returncode != 0: + # If we cannot restore through git, then delete the folder and re-clone + print(f"Unable to restore {self.src_folder}. Deleting and re-cloning...") + delete_folder(self.src_folder) + self.clone_to_local() # Do a re-pull git_pull_cmd = ['git', 'pull'] diff --git a/package-system/OpenEXR/FindImath.cmake b/package-system/OpenEXR/FindImath.cmake deleted file mode 100644 index 227689c0..00000000 --- a/package-system/OpenEXR/FindImath.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -if (TARGET 3rdParty::Imath) - return() -endif() - -include(${CMAKE_CURRENT_LIST_DIR}/o3de_package_utilities.cmake) - -o3de_import_existing_config_files(Imath ${CMAKE_CURRENT_LIST_DIR}/OpenEXR/lib/cmake) - -o3de_import_targets(NAMESPACE_FROM - Imath - NAMESPACE_TO - 3rdParty - COMPONENTS - Imath - ImathConfig) - -# fixup Imath:: it forces /EHsc when compiled on windows MSVC, when it should be doing so when targetted to it instead. -set_target_properties(Imath::Imath PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") - -# if we're not in O3DE, it's also extremely helpful to show a message to logs that indicate that this -# library was successfully picked up, as opposed to the system one. -# A good way to know if you're in O3DE or not is that O3DE sets various cache variables before -# calling find_package, specifically, LY_VERSION_ENGINE_NAME is always set very early: -if (NOT LY_VERSION_ENGINE_NAME) - message(STATUS "Using Imath (${Imath_VERSION}) from ${CMAKE_CURRENT_LIST_DIR}") -endif() diff --git a/package-system/OpenEXR/FindOpenEXR.cmake b/package-system/OpenEXR/FindOpenEXR.cmake index 84bdd1e4..392d513c 100644 --- a/package-system/OpenEXR/FindOpenEXR.cmake +++ b/package-system/OpenEXR/FindOpenEXR.cmake @@ -1,62 +1,10 @@ # # Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # - -if (TARGET 3rdParty::OpenEXR) - return() -endif() - -include(${CMAKE_CURRENT_LIST_DIR}/o3de_package_utilities.cmake) - -# OpenEXR depends on ZLIB. For maximum compatibility here, we use the -# official ZLIB library name, ie, ZLIB::ZLIB and not o3de 3rdParty::ZLIB. -# O3DE's zlib package will define both. If we're in O3DE we can also -# auto-download ZLIB. -if (NOT TARGET ZLIB::ZLIB) - if (COMMAND ly_download_associated_package) - ly_download_associated_package(ZLIB REQUIRED MODULE) - endif() - find_package(ZLIB REQUIRED) -endif() - -find_package(Imath MODULE REQUIRED) # will bring in the FindImath.cmake in the same folder - -# read the existing config files that OpenEXR made when it compiled: -o3de_import_existing_config_files(OpenEXR ${CMAKE_CURRENT_LIST_DIR}/OpenEXR/lib/cmake) - -# map from "OpenEXR::xxxxx to 3rdParty::xxxxxx" -o3de_import_targets(NAMESPACE_FROM - OpenEXR - NAMESPACE_TO - 3rdParty - COMPONENTS - OpenEXRConfig - IexConfig - IlmThreadConfig - Iex - IlmThread - OpenEXRCore - OpenEXRUtil - OpenEXR) - -# fixup OpenEXR::xxxxxx it forces /EHsc when compiled on windows MSVC, when it should be doing so when targetted to it instead: -set_target_properties(OpenEXR::Iex PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") -set_target_properties(OpenEXR::IlmThread PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") -set_target_properties(OpenEXR::OpenEXRCore PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") -set_target_properties(OpenEXR::OpenEXR PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") -set_target_properties(OpenEXR::OpenEXRUtil PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") - -# if we're not in O3DE, it's also extremely helpful to show a message to logs that indicate that this -# library was successfully picked up, as opposed to the system one. -# A good way to know if you're in O3DE or not is that O3DE sets various cache variables before -# calling find_package, specifically, LY_VERSION_ENGINE_NAME is always set very early: -if (NOT LY_VERSION_ENGINE_NAME) - message(STATUS "Using OpenEXR ${OpenEXR_VERSION} from ${CMAKE_CURRENT_LIST_DIR}") -endif() - -# compat - some libraries check for OPENEXR_VERSION even though the correct check is OpenEXR_VERSION -set(OPENEXR_VERSION ${OpenEXR_VERSION}) +# force this into config mode, so that it uses the config files instead of module files. +set(OpenEXR_DIR ${CMAKE_CURRENT_LIST_DIR}) +find_package(OpenEXR 3.4.13 REQUIRED CONFIG) diff --git a/package-system/OpenEXR/README.md b/package-system/OpenEXR/README.md index 82e39348..db8ddcc0 100644 --- a/package-system/OpenEXR/README.md +++ b/package-system/OpenEXR/README.md @@ -1,22 +1,5 @@ -# Ilmbase Build From Source Instructions # -## Prerequisites ## -* 3p-package-scripts (https://github.com/o3de/3p-package-scripts) - -## To build - -set the working directory the the root of the 3p-package-source repository (where the package_build_list* json files are located.) - -# mac - python3 ../3p-package-scripts/o3de_package_scripts/build_package.py --search_path . OpenEXR-3.1.3-rev1-mac -# windows - python ..\3p-package-scripts\o3de_package_scripts\build_package.py --search_path . OpenEXR-3.1.3-rev1-windows -# linux - python3 ../3p-package-scripts/o3de_package_scripts/build_package.py --search_path . OpenEXR-3.1.3-rev1-linux - -# on all platforms: - -Build artifacts will be located in the packages folder. - -## note about iMath library -The iMath library is built as part of OpenEXR but lives in a separate repository. The build script for OpenEXR will fetch imath and pass the same build parameters that were fed in for OpenEXR when building it. This means the command line for OpenEXR should contain both OpenEXR-specific parameters like ``OPENEXR_BUILD_TESTS`` but also more generic parameters that iMath will recognise like ``BUILD_TESTING=OFF`` to be passed through. +## OpenEXR from ASWF +The PATCH file (o3de-oexr.patch) just renames a single file in the vendored openjph library, +to make it so that the object file name does not collide, and trigger +https://github.com/AcademySoftwareFoundation/openexr/issues/2596 diff --git a/package-system/OpenEXR/build_config.json b/package-system/OpenEXR/build_config.json index bdac8aa2..a3a63c82 100644 --- a/package-system/OpenEXR/build_config.json +++ b/package-system/OpenEXR/build_config.json @@ -1,16 +1,18 @@ { "git_url":"https://github.com/AcademySoftwareFoundation/openexr.git", - "git_tag":"v3.1.3", + "git_tag":"v3.4.13", "package_name":"OpenEXR", - "package_version":"3.1.3-rev4", + "package_version":"3.4.13-rev1", "package_url":"https://www.openexr.com/", "package_license":"BSD-3-Clause", "package_license_file":"LICENSE.md", "cmake_find_source":"FindOpenEXR.cmake", "cmake_find_target":"FindOpenEXR.cmake", + "patch_file": "o3de-oexr.patch", "extra_files_to_copy": [ - ["FindImath.cmake", "FindImath.cmake"], - ["../../Scripts/cmake/o3de_package_utilities.cmake", "o3de_package_utilities.cmake"] + ["../../Scripts/cmake/o3de_package_utilities.cmake", "o3de_package_utilities.cmake"], + ["openexr-config.cmake", "openexr-config.cmake"], + ["openexr-config-version.cmake", "openexr-config-version.cmake"] ], "cmake_install_filter":[ "*.cmake", @@ -22,25 +24,36 @@ "cmake_generate_args_common" : [ "-DBUILD_TESTING=OFF", "-DOPENEXR_BUILD_EXAMPLES=OFF", - "-DOPENEXR_INSTALL_EXAMPLES=OFF", "-DOPENEXR_BUILD_TOOLS=OFF", "-DOPENEXR_INSTALL_TOOLS=OFF", - "-DOPENEXR_RUN_FUZZ_TESTS=OFF", + "-DOPENEXR_INSTALL_DOCS=OFF", + "-DBUILD_WEBSITE=OFF", + "-DOPENEXR_BUILD_PYTHON=OFF", + "-DBUILD_TESTING=OFF", + "-DOPENEXR_INSTALL_PKG_CONFIG=OFF", + "-DOPENEXR_USE_TBB=OFF", + "-DOPENEXR_INSTALL_DEVELOPER_TOOLS=OFF", + "-DOPENEXR_BUILD_OSS_FUZZ=OFF", + "-DOPENEXR_TEST_LIBRARIES=OFF", + "-DOPENEXR_TEST_TOOLS=OFF", + "-DOPENEXR_TEST_PYTHON=OFF", "-DBUILD_SHARED_LIBS=OFF", - "-DDOCS=OFF", - "-DPYTHON=OFF" + "-DOPENEXR_FORCE_INTERNAL_DEFLATE=ON", + "-DOPENEXR_FORCE_INTERNAL_OPENJPH=ON", + "-DOPENEXR_IS_SUBPROJECT=ON", + "-DOPENEXR_FORCE_INTERNAL_IMATH=OFF" + ], + "cmake_build_args_common" : [ + "--parallel" ], "Platforms":{ "Windows":{ "Windows":{ "build_configs" : ["Debug", "Release"], - "package_version":"3.1.3-rev5", + "cmake_generate_args": ["-G\"Ninja Multi-Config\""], "depends_on_packages" :[ - ["zlib-1.2.11-rev5-windows", "8847112429744eb11d92c44026fc5fc53caa4a06709382b5f13978f3c26c4cbd", ""] - ], - "cmake_generate_args":[ - "-G", - "\"Visual Studio 16 2019\"" + ["zlib-1.2.11-rev5-windows", "8847112429744eb11d92c44026fc5fc53caa4a06709382b5f13978f3c26c4cbd", ""], + ["Imath-3.2.2-rev2-windows", "d2ca872921bb690ae039495f9bdf7038a4155cd0f8f272774e8159088bf433fe", ""] ], "custom_test_cmd" : [ "test_openexr_windows.cmd" @@ -48,7 +61,8 @@ }, "Android": { "depends_on_packages" :[ - ["zlib-1.2.11-rev5-android", "73c9e88892c237a3fc6eafc04268ccd9d479e6d55f9df2ed58b236c8f9cf2cae", ""] + ["zlib-1.2.11-rev5-android", "73c9e88892c237a3fc6eafc04268ccd9d479e6d55f9df2ed58b236c8f9cf2cae", ""], + ["Imath-3.2.2-rev2-android", "c41d3b86cd2cc40f57b209c8f838506898914951290a3cc1f592a51ff71dc494", ""] ], "build_configs" : ["Release"], "cmake_generate_args_release": [ @@ -63,26 +77,11 @@ } }, "Darwin":{ - "Mac":{ - "build_configs" : ["Release"], - "depends_on_packages" :[ - ["zlib-1.2.11-rev5-mac", "b6fea9c79b8bf106d4703b67fecaa133f832ad28696c2ceef45fb5f20013c096", ""] - ], - "custom_toolchain_file" : "../cmake/Platform/Mac/Toolchain_mac.cmake", - "cmake_generate_args_release": [ - "-G", - "Xcode" - ], - "custom_test_cmd" : [ - "./test_openexr_mac.sh" - ] - }, "Mac-arm64":{ - "git_tag":"v3.4.4", - "package_version":"3.4.4-rev1", "build_configs" : ["Release"], "depends_on_packages" :[ - ["zlib-1.3.1-rev2-mac-arm64", "52e62890329d3e003226fca88df30701cdd862a5f137eb5f75dff504377c13b3", ""] + ["zlib-1.3.1-rev2-mac-arm64", "52e62890329d3e003226fca88df30701cdd862a5f137eb5f75dff504377c13b3", ""], + ["Imath-3.2.2-rev2-mac-arm64", "5fc5088717927da41c33f2f100c68691a3277d7b564060fdd4743a1b0ffd50f1", ""] ], "custom_toolchain_file" : "../cmake/Platform/Mac/Toolchain_mac.cmake", "cmake_generate_args_release": [ @@ -90,18 +89,20 @@ "Xcode" ], "custom_test_cmd" : [ - "./test_openexr_mac_3_4.sh" + "./test_openexr_mac.sh" ] }, "iOS":{ "build_configs" : ["Release"], "depends_on_packages" :[ - ["zlib-1.2.11-rev5-ios", "c7f10b4d0fe63192054d926f53b08e852cdf472bc2b18e2f7be5aecac1869f7f", ""] + ["zlib-1.2.11-rev5-ios", "c7f10b4d0fe63192054d926f53b08e852cdf472bc2b18e2f7be5aecac1869f7f", ""], + ["Imath-3.2.2-rev2-ios", "0ca26f7e9cdeaa940caac39b5a7f5db0344d7f76cca4123874e4e10a6ec0e907", ""] ], "custom_toolchain_file" : "../cmake/Platform/iOS/Toolchain_ios.cmake", "cmake_generate_args_release": [ "-G", - "Xcode" + "Xcode", + "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH" ], "custom_test_cmd" : [ "./test_openexr_ios.sh" @@ -112,7 +113,8 @@ "Linux":{ "build_configs" : ["release"], "depends_on_packages" :[ - ["zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", ""] + ["zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", ""], + ["Imath-3.2.2-rev2-linux", "aec34a555a893c64f7a8f00262378e15d13b666a05e0298cba7025faed99117f", ""] ], "cmake_generate_args_release":[ "-G", @@ -126,7 +128,8 @@ "Linux-aarch64":{ "build_configs" : ["release"], "depends_on_packages" :[ - ["zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", ""] + ["zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", ""], + ["Imath-3.2.2-rev2-linux-aarch64", "5494761ec31afea8e436dcd942492b9de24c538601f550294873169a3b5219ba", ""] ], "cmake_generate_args_release":[ "-G", diff --git a/package-system/OpenEXR/o3de-oexr.patch b/package-system/OpenEXR/o3de-oexr.patch new file mode 100644 index 00000000..d8fc7212 --- /dev/null +++ b/package-system/OpenEXR/o3de-oexr.patch @@ -0,0 +1,4 @@ +diff --git a/external/OpenJPH/src/core/others/ojph_mem.c b/external/OpenJPH/src/core/others/ojph_mem_c.c +similarity index 100% +rename from external/OpenJPH/src/core/others/ojph_mem.c +rename to external/OpenJPH/src/core/others/ojph_mem_c.c diff --git a/package-system/OpenEXR/openexr-config-version.cmake b/package-system/OpenEXR/openexr-config-version.cmake new file mode 100644 index 00000000..9f15a0ea --- /dev/null +++ b/package-system/OpenEXR/openexr-config-version.cmake @@ -0,0 +1,25 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(PACKAGE_VERSION 3.4.13) +set(PACKAGE_VERSION_EXACT False) +set(PACKAGE_VERSION_COMPATIBLE False) + +if (NOT ${PACKAGE_FIND_NAME} STREQUAL "OpenEXR") + return() +endif() + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + return() +endif() + +set(PACKAGE_VERSION_COMPATIBLE TRUE) + +if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) +endif() diff --git a/package-system/OpenEXR/openexr-config.cmake b/package-system/OpenEXR/openexr-config.cmake new file mode 100644 index 00000000..6d8c9dbb --- /dev/null +++ b/package-system/OpenEXR/openexr-config.cmake @@ -0,0 +1,63 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +# This version of OpenEXR needs to work with and without O3DE's macros and scripts +include(${CMAKE_CURRENT_LIST_DIR}/o3de_package_utilities.cmake) + +# OpenEXR depends on ZLIB. For maximum compatibility here, we use the +# official ZLIB library name, ie, ZLIB::ZLIB and not o3de 3rdParty::ZLIB. +# O3DE's zlib package will define both. If we're in O3DE we can also +# auto-download ZLIB. +if (NOT TARGET ZLIB::ZLIB) + if (COMMAND ly_download_associated_package) + ly_download_associated_package(ZLIB REQUIRED MODULE) + endif() + find_package(ZLIB REQUIRED) +endif() + +include(CMakeFindDependencyMacro) + +# read the existing config files that OpenEXR made when it compiled: +o3de_import_existing_config_files(OpenEXR ${CMAKE_CURRENT_LIST_DIR}/OpenEXR/lib/cmake) + +# map from "OpenEXR::xxxxx to 3rdParty::xxxxxx" +o3de_import_targets(NAMESPACE_FROM + OpenEXR + NAMESPACE_TO + 3rdParty + COMPONENTS + OpenEXRConfig + IexConfig + IlmThreadConfig + Iex + IlmThread + OpenEXRCore + OpenEXRUtil + OpenEXR) +if (NOT OpenEXR_FOUND) + message(FATAL_ERROR "OpenEXR not found despite running the built-in OpenEXR import scripts from ${CMAKE_CURRENT_LIST_DIR}/OpenEXR/lib/cmake") +endif() + +# fixup OpenEXR::xxxxxx it forces /EHsc when compiled on windows MSVC, when it should be doing so when targetted to it instead: +set_target_properties(OpenEXR::Iex PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") +set_target_properties(OpenEXR::IlmThread PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") +set_target_properties(OpenEXR::OpenEXRCore PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") +set_target_properties(OpenEXR::OpenEXR PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") +set_target_properties(OpenEXR::OpenEXRUtil PROPERTIES INTERFACE_COMPILE_OPTIONS "$<$:/EHsc>") + +# if we're not in O3DE, it's also extremely helpful to show a message to logs that indicate that this +# library was successfully picked up, as opposed to the system one. +# A good way to know if you're in O3DE or not is that O3DE sets various cache variables before +# calling find_package, specifically, LY_VERSION_ENGINE_NAME is always set very early: +if (NOT LY_VERSION_ENGINE_NAME AND NOT ALREADY_MENTIONED_OPENEXR) + set(ALREADY_MENTIONED_OPENEXR TRUE) + message(STATUS "Using O3DE's OpenEXR ${OpenEXR_VERSION} (BSD-3-Clause) from ${CMAKE_CURRENT_LIST_DIR}") +endif() + +# compat - some libraries check for OPENEXR_VERSION even though the correct check is OpenEXR_VERSION +set(OPENEXR_VERSION ${OpenEXR_VERSION}) diff --git a/package-system/OpenEXR/test/CMakeLists.txt b/package-system/OpenEXR/test/CMakeLists.txt index d89e7b60..373b0d16 100644 --- a/package-system/OpenEXR/test/CMakeLists.txt +++ b/package-system/OpenEXR/test/CMakeLists.txt @@ -10,12 +10,12 @@ cmake_minimum_required(VERSION 3.20) PROJECT(test_openexr VERSION 1.0 LANGUAGES C CXX) -find_package(OpenEXR) -find_package(Imath) +# Necessary to override iOS toolchain behavior of +# setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY, which prevents it from looking for packages +# anywhere except in the sysroot (ie, inside xcode's ios SDK subfolder). +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) -if (OPENEXR_TEST_VER_3_4) - add_compile_definitions(OPENEXR_TEST_VER_3_4) -endif() +find_package(OpenEXR) add_executable(test_openexr test_openexr.cpp) diff --git a/package-system/OpenEXR/test/test_openexr.cpp b/package-system/OpenEXR/test/test_openexr.cpp index 14552ce5..37176d82 100644 --- a/package-system/OpenEXR/test/test_openexr.cpp +++ b/package-system/OpenEXR/test/test_openexr.cpp @@ -9,13 +9,8 @@ #include #include -#if defined(OPENEXR_TEST_VER_3_4) -using namespace Imf_3_4; -using namespace Imath_3_2; -#else -using namespace Imf_3_1; -using namespace Imath_3_1; -#endif +using namespace Imf; +using namespace Imath; int readHeader(const char fileName[], diff --git a/package-system/OpenEXR/test_openexr_mac_3_4.sh b/package-system/OpenEXR/test_openexr_mac_3_4.sh deleted file mode 100755 index 23f1e66d..00000000 --- a/package-system/OpenEXR/test_openexr_mac_3_4.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -rm -rf temp/build_test -mkdir temp/build_test - -cmake -S test -B temp/build_test -G Xcode \ - -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake \ - -DCMAKE_MODULE_PATH="$DOWNLOADED_PACKAGE_FOLDERS;$PACKAGE_ROOT" \ - -DOPENEXR_TEST_VER_3_4=TRUE || exit 1 - -cmake --build temp/build_test --parallel --config Release || exit 1 -temp/build_test/Release/test_openexr.app/Contents/MacOS/test_openexr || exit 1 - -cmake --build temp/build_test --parallel --config Debug || exit 1 -temp/build_test/Debug/test_openexr.app/Contents/MacOS/test_openexr || exit 1 - -exit 0 diff --git a/package-system/OpenEXR/test_openexr_windows.cmd b/package-system/OpenEXR/test_openexr_windows.cmd index 8fcd49d6..4df8ad51 100644 --- a/package-system/OpenEXR/test_openexr_windows.cmd +++ b/package-system/OpenEXR/test_openexr_windows.cmd @@ -14,6 +14,8 @@ set "PACKAGE_ROOT=%PACKAGE_ROOT:\=/%" set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%" cmake -S test -B temp/build_test ^ + -G "Visual Studio 17 2022" ^ + -DCMAKE_PREFIX_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" ^ -DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" || exit /b 1 cmake --build temp/build_test --parallel --config Release || exit /b 1 diff --git a/package_build_list_host_darwin-arm64.json b/package_build_list_host_darwin-arm64.json index d36b12df..a1a22219 100644 --- a/package_build_list_host_darwin-arm64.json +++ b/package_build_list_host_darwin-arm64.json @@ -20,7 +20,8 @@ "mcpp-2.7.2_az.2-rev3-mac-arm64": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.2-rev3", "mikkelsen-1.0.0.5-mac-arm64": "package-system/mikkelsen/build_package_image.py --platform mac-arm64", "NvCloth-v1.1.6-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/NvCloth --platform-name Mac-arm64 --clean", - "OpenEXR-3.4.4-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Mac-arm64 --clean", + "OpenEXR-3.4.13-rev1-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name iOS --clean", + "OpenEXR-3.4.13-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Mac-arm64 --clean", "openimageio-opencolorio-2.3.17-rev4-mac-arm64": "package-system/openimageio-opencolorio/build_openimageio.py --platform darwin-arm64 --package-name=openimageio-opencolorio-2.3.17-rev4-mac-arm64 --clean", "OpenSSL-3.6.3-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Mac-arm64 --clean", "PhysX-4.1.2-rev9-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/PhysX --platform-name Mac-arm64 --clean", @@ -54,7 +55,8 @@ "mcpp-2.7.2_az.2-rev3-mac-arm64": "package-system/temp/mcpp-mac-arm64", "mikkelsen-1.0.0.5-mac-arm64": "package-system/mikkelsen-mac-arm64", "NvCloth-v1.1.6-rev1-mac-arm64": "package-system/NvCloth/temp/NvCloth-mac-arm64", - "OpenEXR-3.4.4-rev1-mac-arm64": "package-system/OpenEXR/temp/OpenEXR-mac-arm64", + "OpenEXR-3.4.13-rev1-mac-arm64": "package-system/OpenEXR/temp/OpenEXR-mac-arm64", + "OpenEXR-3.4.13-rev1-ios": "package-system/OpenEXR/temp/OpenEXR-ios", "openimageio-opencolorio-2.3.17-rev4-mac-arm64": "package-system/openimageio-opencolorio/temp/package-darwin-arm64", "OpenSSL-3.6.3-rev1-mac-arm64": "package-system/OpenSSL/temp/OpenSSL-mac-arm64", "PhysX-4.1.2-rev9-mac-arm64": "package-system/PhysX/temp/PhysX-mac-arm64", diff --git a/package_build_list_host_linux-aarch64.json b/package_build_list_host_linux-aarch64.json index d61d400e..ac9f2500 100644 --- a/package_build_list_host_linux-aarch64.json +++ b/package_build_list_host_linux-aarch64.json @@ -23,7 +23,7 @@ "mcpp-2.7.2_az.1-rev1-linux-aarch64": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1", "mikkelsen-1.0.0.4-linux-aarch64": "package-system/mikkelsen/build_package_image.py --platform linux-aarch64", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux-aarch64": "package-system/NvCloth/build_package_image.py --platform-name linux-aarch64", - "OpenEXR-3.1.3-rev4-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux-aarch64 --clean", + "OpenEXR-3.4.13-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux-aarch64 --clean", "openimageio-opencolorio-2.3.17-rev2-linux-aarch64": "package-system/openimageio-opencolorio/build_openimageio.py --package-name=openimageio-opencolorio-2.3.17-rev2-linux-aarch64 --platform linux-aarch64 --clean", "OpenMesh-8.1-rev3-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux-aarch64 --clean", "OpenSSL-3.6.3-rev1-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Linux-aarch64 --clean", @@ -63,7 +63,7 @@ "mikkelsen-1.0.0.4-linux-aarch64": "package-system/mikkelsen-linux-aarch64", "mcpp-2.7.2_az.1-rev1-linux-aarch64": "package-system/mcpp-linux-aarch64", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux-aarch64": "package-system/NvCloth-linux-aarch64", - "OpenEXR-3.1.3-rev4-linux-aarch64": "package-system/OpenEXR/temp/OpenEXR-linux-aarch64", + "OpenEXR-3.4.13-rev1-linux-aarch64": "package-system/OpenEXR/temp/OpenEXR-linux-aarch64", "openimageio-opencolorio-2.3.17-rev2-linux-aarch64": "package-system/openimageio-opencolorio/temp/package-linux-aarch64", "OpenMesh-8.1-rev3-linux-aarch64": "package-system/OpenMesh/temp/OpenMesh-linux-aarch64", "OpenSSL-3.6.3-rev1-linux-aarch64": "package-system/OpenSSL/temp/OpenSSL-linux-aarch64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 1649ee58..770b0360 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -24,7 +24,7 @@ "pyside2-5.15.2.1-py3.10-rev7-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux --package-root ../../package-system/pyside2/temp --clean", "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Linux-aarch64 --package-root ../../package-system/pyside2/temp --clean", "pyside6-6.10.2-py3.10-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside6 --platform-name Linux --clean", - "OpenEXR-3.1.3-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --package-root ../../package-system/OpenEXR/temp --clean", + "OpenEXR-3.4.13-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --clean", "OpenXR-1.0.22-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenXR --platform-name Linux --package-root ../../package-system --clean", "openimageio-opencolorio-2.3.17-rev2-linux": "package-system/openimageio-opencolorio/build_openimageio.py --package-name=openimageio-opencolorio-2.3.17-rev2-linux --clean", "OpenSSL-3.6.3-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenSSL --platform-name Linux --clean", @@ -73,7 +73,7 @@ "pyside2-5.15.2.1-py3.10-rev7-linux": "package-system/pyside2/temp/pyside2-linux", "pyside2-5.15.2.1-py3.10-rev7-linux-aarch64": "package-system/pyside2/temp/pyside2-linux-aarch64", "pyside6-6.10.2-py3.10-rev5-linux": "package-system/pyside6/temp/pyside6-linux", - "OpenEXR-3.1.3-rev4-linux": "package-system/OpenEXR/temp/OpenEXR-linux", + "OpenEXR-3.4.13-rev1-linux": "package-system/OpenEXR/temp/OpenEXR-linux", "OpenXR-1.0.22-rev2-linux": "package-system/OpenXR-linux", "openimageio-opencolorio-2.3.17-rev2-linux": "package-system/openimageio-opencolorio/temp/package-linux", "OpenSSL-3.6.3-rev1-linux": "package-system/OpenSSL/temp/OpenSSL-linux", diff --git a/package_build_list_host_windows.json b/package_build_list_host_windows.json index 30de7211..be619788 100644 --- a/package_build_list_host_windows.json +++ b/package_build_list_host_windows.json @@ -36,7 +36,8 @@ "mikkelsen-1.0.0.4-windows": "package-system/mikkelsen/build_package_image.py", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows": "package-system/NvCloth/build_package_image.py --platform-name windows", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-android": "package-system/NvCloth/build_package_image.py --platform-name android", - "OpenEXR-3.1.3-rev5-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Windows --package-root ../../package-system/OpenEXR/temp --clean", + "OpenEXR-3.4.13-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Windows --clean", + "OpenEXR-3.4.13-rev1-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Android --clean", "openimageio-opencolorio-2.3.17-rev4-windows": "package-system/openimageio-opencolorio/build_openimageio.py --package-name=openimageio-opencolorio-2.3.17-rev4-windows", "OpenMesh-8.1-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Windows --package-root ../../package-system --clean", "OpenSSL-3.6.3-rev2-android": "package-system/OpenSSL/build_package_image.py --platform-name android", @@ -108,7 +109,8 @@ "mikkelsen-1.0.0.4-windows": "package-system/mikkelsen-windows", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows": "package-system/NvCloth-windows", "NvCloth-v1.1.6-4-gd243404-pr58-rev1-android": "package-system/NvCloth-android", - "OpenEXR-3.1.3-rev5-windows": "package-system/OpenEXR/temp/OpenEXR-windows", + "OpenEXR-3.4.13-rev1-windows": "package-system/OpenEXR/temp/OpenEXR-windows", + "OpenEXR-3.4.13-rev1-android": "package-system/OpenEXR/temp/OpenEXR-android", "openimageio-opencolorio-2.3.17-rev4-windows": "package-system/openimageio-opencolorio/temp/package-windows", "OpenMesh-8.1-rev3-windows": "package-system/OpenMesh-windows", "OpenSSL-3.6.3-rev2-android": "package-system/OpenSSL/temp/OpenSSL-android",