Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build-time options for where to get Imath #944

Merged
merged 1 commit into from
Mar 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions cmake/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ endif()
#######################################

# Check to see if Imath is installed outside of the current build directory.
set(IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
"Repo for auto-build of Imath")
set(IMATH_TAG "master" CACHE STRING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to pin it to a specific version instead of using master?
What happens if I check out this state in one year - may be in the meanwhile something has changed which breaks the build, because the future Imath master does not work with this version - I would suggest pinning it to a specific version - same is done here: https://github.com/AcademySoftwareFoundation/openexr/blob/master/bazel/third_party/openexr.bzl
The Bazel build could also use master for Imath - but this would make also testing in the CI random

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what the comment says right after that -- that it's "master" but needs to be changed by the release, so point to a specific tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 253:

#TODO: ^^ Release should not clone from master, this is a place holder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - I should read everything ;)

"Tag for auto-build of Imath (branch, tag, or SHA)")
#TODO: ^^ Release should not clone from master, this is a place holder
set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-build/config")
find_package(Imath QUIET)
set(CMAKE_IGNORE_PATH)
Expand All @@ -254,12 +259,12 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
if (${CMAKE_VERSION} VERSION_LESS "3.11.0")
message(FATAL_ERROR "CMake 3.11 or newer is required for FetchContent, you must manually install Imath if you are using an earlier version of CMake")
endif()
message(STATUS "Imath was not found, installing from github")
message(STATUS "Imath was not found, installing from ${IMATH_REPO} (${IMATH_TAG})")

include(FetchContent)
FetchContent_Declare(Imath
GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/Imath.git
GIT_TAG origin/master #TODO: Release should not clone from master, this is a place holder
GIT_REPOSITORY ${IMATH_REPO}
GIT_TAG ${IMATH_TAG}
GIT_SHALLOW ON
)

Expand Down