AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

[FEATURE REQUEST] CMake Subdirectory Support

Open
#2,546 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 9h
Merged PRs (30d)
48

Description

**Is your feature request related to a problem? Please describe.**
In my projects, I prefer to have all the dependencies as submodules, which are then included in the projects CMake build system by ``add_subdirectory``. However, it seems that this does not work with oiio.

I think that this is due to lines such as [128](https://github.com/OpenImageIO/oiio/blob/6307f02457311427515b83e0912e8fefd8a6f53c/CMakeLists.txt#L128), where it requires oiio to be built in ``CMAKE_BINARY_DIR``, which may not be the case if it is in a subdirectory.

**Describe the solution you'd like**
Reconfiguration of the CMake files such that they do not rely directly on ``CMAKE_BINARY_DIR``, but instead use ``CMAKE_CURRENT_BINARY_DIR``, so that the project can be compiled as a dependency of other projects.

Contributor guide

Open the contributing guide

Research direction

Start at CMakeLists.txt line 128 and inspect the CMake files for uses of CMAKE_BINARY_DIR. Configure OpenImageIO as an add_subdirectory dependency and verify that it compiles without relying on the parent project's binary directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.