-
Notifications
You must be signed in to change notification settings - Fork 491
Build external dependencies with FetchContent #1638
Copy link
Copy link
Open
Labels
Build IssueIssues related to build or environment problems on any platform.Issues 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.Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.
Metadata
Metadata
Assignees
Labels
Build IssueIssues related to build or environment problems on any platform.Issues 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.Issues that the TSC has decided are worth implementing, but don't currently have the dev resources.
When we are missing external dependencies and
OCIO_INSTALL_EXT_PACKAGEShas been set toMISSINGorALL, 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_modulewhich 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_subdirectoryand make the integration easier.