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

Have OCIO build export a proper OpenColorIOConfig.cmake #1187

Closed
lgritz opened this issue Nov 1, 2020 · 7 comments
Closed

Have OCIO build export a proper OpenColorIOConfig.cmake #1187

lgritz opened this issue Nov 1, 2020 · 7 comments
Labels
help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.

Comments

@lgritz
Copy link
Collaborator

lgritz commented Nov 1, 2020

The modern CMake way is that packages should produce and distribute a PackageConfig.cmake, eliminating the need for all the other CMake-based packages that depend on OCIO from each, separately, having to maintain some kind of FindOpenColorIO.cmake module that contains all the searching logic.

@lgritz lgritz changed the title Have OCIO build export a proper OpenColorConfig.cmake Have OCIO build export a proper OpenColorIOConfig.cmake Nov 1, 2020
@hodoulp hodoulp added help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources. v2.0 labels Nov 1, 2020
@Yash-R
Copy link

Yash-R commented Nov 2, 2020

Hey, i would like to help you with this issue can you guide me ??

@hodoulp
Copy link
Member

hodoulp commented Nov 2, 2020

Hi @Yash-R,
Happy to see a volunteer to help the OpenColorIO development.

The task requires some knowledge of C++ and CMake because it involves developing a CMake utility to find a C++ library in a multi-platform project. Below are some examples:

If you still have interest in the task then start the work and the community will help you.

@Yash-R
Copy link

Yash-R commented Nov 2, 2020

yes I'm very much interested to work, Can you please explain me the work briefly please ? @hodoulp

@hodoulp
Copy link
Member

hodoulp commented Nov 2, 2020

The CMake utility helps other projects to discover an installed OpenColorIO library (i.e which means where are the header files, where are the binary file(s), and what is the version). In the previous post I pasted some examples. So, OpenColorIO must have a findOpenColorIO.cmake file and install it.
Keep in mind that the file detection is, most of the time, platform dependant (i.e OpenColorIO supports Windows, MacOS and Linux).

Before starting anything I suggest you to start reading the documentation, and to check on how to contribute to the project.

@stilllman
Copy link

So, OpenColorIO must have a findOpenColorIO.cmake file and install it.

The proper solution would be to install a config-file package (OpenColorIOConfig.cmake), not a find-module package. Find-modules are useful for finding libraries that are not CMake-friendly, if your goal is to make OpenColorIO easily consumable through CMake then you should export your targets in a config-file. A good start would be to read the documentation here: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html

For the record, OpenColorIO 1.1 was actually already installing a config-file package, but this feature was removed by this commit apparently: 2f5fbfc

@lgritz
Copy link
Collaborator Author

lgritz commented May 1, 2021

I noticed today that OCIO doesn't provide a modern OpenColorIOConfig.cmake file with all the targets a downstream project should need, went to add an issue, only to discover that I had already filed this same issue right here, exactly six months ago to the day. (I guess we can place a tight upper bound on the length my memory for such things.)

So I reiterate the original request, it's what most modern cmake-based projects provide for their downstream clients, and expect from their upstream cmake-aware dependencies. I can point you to code in the cmake build systems of OIIO or OSL as examples. It's only a handful of lines to do it properly.

@hodoulp
Copy link
Member

hodoulp commented Jun 22, 2021

Closing the issue as the pull request is now merged!

@hodoulp hodoulp closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.
Projects
None yet
Development

No branches or pull requests

4 participants