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

Adsk contrib - Add support for minimum and recommended versions for dependencies #1777

Conversation

cedrik-fuoco-adsk
Copy link
Contributor

Something went wrong in the previous PR while trying to rebase the branch.

I created a fresh branch from main and merged my changes, which went much smoother.


Adding support for minimum, maximum and recommended versions for OCIO dependencies.

  • Added two new macros to handle the logic: ocio_handle_dependency and ocio_install_dependency.
  • The download and install part of each OCIO dependency are now split into two files.
    • Under share/cmake/modules/FindXYZ.cmake and share/cmake/modules/install/InstallXYZ.cmake
  • Added an option OCIO_VERBOSE to print more information when CMake is calling the Find modules.
  • Refactored what gets printed when we build as well as some colours when modules are found.
  • FindOpenImageIO.cmake was removed in favour of their CMake configuration file (as recommended by OIIO). The FindOpenImageIO.cmake that we had was coming from OIIO originally, but it is not supported anymore.
  • FindOpenEXR.cmake was removed in favour of their CMake configuration files. Our FindOpenEXR.cmake was basically just doing a search for their CMake's configuration files, but we don't need a whole Find module to do that.

Here's a snippet of a build log:

image

Implemention of minimum, maximum and recommended version.
Refactor the FindOpenImageIO to be inline with the rest of the custom find module (OCIO_USE_OIIO_CMAKE_CONFIG is no longer needed).
Added a new option called OCIO_VERBOSE. It allow the user to tell OCIO to display more information when searching and building the dependencies.
Splitted the find and install part into two files - Find<pkg>.cmake and Install<pkg>.cmake.

Signed-off-by: Cédrik Fuoco <[email protected]>
Setting policy CMP0042 when building ZLIB since that project is using an old CMake version as the cmake_minimum_required and that version has no knowledge of the policy.
Fixing a potential issue in Installopenfx. Changing back the version to 1.4 as before.
Ignoring warning from OpenImageIO for imageioapphelpers. The same warning are ignored for ociodisplay, ocioconvert and ociolutimage.

Signed-off-by: Cédrik Fuoco <[email protected]>
…acOS.

Renamed FindOpenShadingLanguage to FindOSL to match the project name used the OSL's CMakefile.
Cleanup the code for FindOSL and removed duplicate warning about needed C++14.

Updated the header comments for all Find and Install modules.

Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Renamed ocio_install_package to ocio_install_dependency
The "Installing [...]" message from Install module is now under OCIO_VERBOSE variable. Added a message in ocio_install_dependency instead
Improve the colors usage in the logging

Signed-off-by: Cédrik Fuoco <[email protected]>
…ith the prefix of ocio_handle_dependency since they were the same.

Removed FindOpenEXR.cmake and FindOpenImageIO.cmake since they are not needed anymore (for differente reason).
Added PROMOTE_TARGET option for ocio_handle_dependency which promote the target to GLOBAL.

Signed-off-by: Cédrik Fuoco <[email protected]>
Re-worded some of the comments

Signed-off-by: Cédrik Fuoco <[email protected]>
…ting OCIO_INSTALL_EXT_PACKAGES option correctly.

Signed-off-by: Cédrik Fuoco <[email protected]>
…ib since the user can update their cmake in order to do that.

Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
Signed-off-by: Cédrik Fuoco <[email protected]>
…rsions-for-dependencies' into adsk_contrib/add-support-for-min-recommended-versions

Signed-off-by: Cédrik Fuoco <[email protected]>
@cedrik-fuoco-adsk cedrik-fuoco-adsk changed the title Adsk contrib - Add support for minimum and recommended versions for dependencies (#2) Adsk contrib - Add support for minimum and recommended versions for dependencies (redo) Mar 9, 2023
@cedrik-fuoco-adsk cedrik-fuoco-adsk changed the title Adsk contrib - Add support for minimum and recommended versions for dependencies (redo) Adsk contrib - Add support for minimum and recommended versions for dependencies Mar 9, 2023
@doug-walker
Copy link
Collaborator

Regarding our usual 2-week clock on these Autodesk PRs, this PR is identical to PR #1772 which had already been open for two weeks. So it is our intention to merge this one as soon as it is approved. Other work is gated by this, thanks.

@remia remia linked an issue Mar 21, 2023 that may be closed by this pull request
@doug-walker
Copy link
Collaborator

@remia , we think we've addressed all of your comments from PR #1772, could you review this one again please? Thanks in advance!

Copy link
Collaborator

@remia remia left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for taking care of the rebase @cedrik-fuoco-adsk. Just a question about zlib, but that should not prevent merge and can be discussed in #1771. Great work!

set(CMAKE_FIND_LIBRARY_SUFFIXES)
endif()
ocio_handle_dependency( ZLIB REQUIRED ALLOW_INSTALL
MIN_VERSION 1.2.10
Copy link
Collaborator

Choose a reason for hiding this comment

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

[Question] Is the 1.2.10 version the minimum compatible, how did we picked it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We basically just picked what seemed like a sufficiently old version, and did not invest the time to see what is actually the oldest that would work. If someone has a need for an older version, please post the requirement in issue #1771.

I will go ahead and merge this now since it is blocking another task. Thank you Remi!

@doug-walker doug-walker merged commit e93efe3 into AcademySoftwareFoundation:main Mar 22, 2023
@doug-walker doug-walker deleted the adsk_contrib/add-support-for-min-recommended-versions branch March 22, 2023 21:12
cedrik-fuoco-adsk added a commit to autodesk-forks/OpenColorIO that referenced this pull request Mar 24, 2023
…ependencies (AcademySoftwareFoundation#1777)

* Implementation of ocio_find_package and ocio_install_package macro.
Implemention of minimum, maximum and recommended version.
Refactor the FindOpenImageIO to be inline with the rest of the custom find module (OCIO_USE_OIIO_CMAKE_CONFIG is no longer needed).
Added a new option called OCIO_VERBOSE. It allow the user to tell OCIO to display more information when searching and building the dependencies.
Splitted the find and install part into two files - Find<pkg>.cmake and Install<pkg>.cmake.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Removing a duplicate call to set_property in OpenImageIO find module.
Setting policy CMP0042 when building ZLIB since that project is using an old CMake version as the cmake_minimum_required and that version has no knowledge of the policy.
Fixing a potential issue in Installopenfx. Changing back the version to 1.4 as before.
Ignoring warning from OpenImageIO for imageioapphelpers. The same warning are ignored for ociodisplay, ocioconvert and ociolutimage.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fixed an issue with FindOpenImageIO that was found while testing on macOS.
Renamed FindOpenShadingLanguage to FindOSL to match the project name used the OSL's CMakefile.
Cleanup the code for FindOSL and removed duplicate warning about needed C++14.

Updated the header comments for all Find and Install modules.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fixing typo

Signed-off-by: Cédrik Fuoco <[email protected]>

* Renamed ocio_find_package to ocio_handle_dependency
Renamed ocio_install_package to ocio_install_dependency
The "Installing [...]" message from Install module is now under OCIO_VERBOSE variable. Added a message in ocio_install_dependency instead
Improve the colors usage in the logging

Signed-off-by: Cédrik Fuoco <[email protected]>

* Changed prefix for ocio_install_dependency since it was conflicting with the prefix of ocio_handle_dependency since they were the same.
Removed FindOpenEXR.cmake and FindOpenImageIO.cmake since they are not needed anymore (for differente reason).
Added PROMOTE_TARGET option for ocio_handle_dependency which promote the target to GLOBAL.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Mostly comments and documentations

Signed-off-by: Cédrik Fuoco <[email protected]>

* Small update of the Existing Install Hints section

Signed-off-by: Cédrik Fuoco <[email protected]>

* Changed RECOMMENDED_MIN_VERSION to RECOMMENDED_VERSION
Re-worded some of the comments

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fixing issue with ocio_handle_dependency macro where it wasn't respecting OCIO_INSTALL_EXT_PACKAGES option correctly.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Adding more documentations and dropping support to look for static zlib since the user can update their cmake in order to do that.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Documentations

Signed-off-by: Cédrik Fuoco <[email protected]>

* Documentations

Signed-off-by: Cédrik Fuoco <[email protected]>

* fixing typo

Signed-off-by: Cédrik Fuoco <[email protected]>

* Fix typo and fix issue when OCIO is installing ZLIB

Signed-off-by: Cédrik Fuoco <[email protected]>

* Tentative fix for Linux CI failure

Signed-off-by: Cédrik Fuoco <[email protected]>

* Ignoring specifics warnings on OpenImageIO target directly.

Signed-off-by: Cédrik Fuoco <[email protected]>

* Removing OCIO_USE_OIIO_CMAKE_CONFIG as it is not needed anymore.

Signed-off-by: Cédrik Fuoco <[email protected]>

---------

Signed-off-by: Cédrik Fuoco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zlib dependency requirement for 2.2.1
3 participants