AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO
OpenColorIO skips find_package for some 3rd party dependencies when "PackageName_ROOT" is defined
- Vorherrschende Sprache
- C++
- Sterne
- 2.1k
- Forks
- 503
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
OpenColorIO has some 3rd party dependencies for which custom "FindPackageName.cmake" files have been written. Examples: yaml-cpp, Imath, minizip-ng,... These all check if the "PackageName_ROOT" variable is defined and if not they call find_package(PackageName).
For example for yaml-cpp:
```
# Search for yaml-cpp-config.cmake
if(NOT DEFINED yaml-cpp_ROOT)
find_package(yaml-cpp ${yaml-cpp_FIND_VERSION} CONFIG ${quiet})
endif()
```
The [CMake documentation of find_package](https://cmake.org/cmake/help/latest/command/find_package.html) states however that the location referred to by the variable "PackageName_ROOT" is searched first to find the package. In our build setup we do set this variable so that find_package commands will find the appropriate version (i.e., the one we build from source). Because of "if(NOT DEFINED...)" the find_package call is skipped in this case, which is unexpected behavior for us.
What is the reasoning behind this implementation? At first sight it doesn't seem to comply with the CMake docs.
Beitragsleitfaden
Rechercherichtung
Beginne mit der Untersuchung der im Issue erwähnten benutzerdefinierten FindPackageName.cmake-Implementierungen, insbesondere des yaml-cpp-Beispiels, und vergleiche deren PackageName_ROOT-Guards mit der CMake-Dokumentation zu find_package. Ermittle, ob der Guard beabsichtigt ist, und kläre das erwartete Verhalten; der Abschluss sollte die im Issue aufgeworfene Frage beantworten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cmake, cpp
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100