Skip to content

Build external dependencies with FetchContent #1638

@remia

Description

@remia

When we are missing external dependencies and OCIO_INSTALL_EXT_PACKAGES has been set to MISSING or ALL , we use CMake ExternalProject to build these locally. This works but tends to be hard to manage correctly with modern CMake library that can export a number of targets as well as custom commands and probably other items. We also have a lot of manual CMake flags passing from the main project to the external ones, that are easy to miss.

An example of this would be OpenEXR which export more than 5 different targets we have to manually create, at the risk of getting out of sync when something changes upstream. Another case is pybind11 which export custom commands like pybind11_add_module which we cannot currently use in the build because it will not be there when pybind11 has been built locally I believe.

For well behaved modern CMake dependencies, it may be good to look into FetchContent instead, which behave similar to add_subdirectory and make the integration easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Build IssueIssues related to build or environment problems on any platform.help wantedIssues that the TSC has decided are worth implementing, but don't currently have the dev resources.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions