AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

OpenColorIO skips find_package for some 3rd party dependencies when "PackageName_ROOT" is defined

Abierto
#2,185 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
2.1k
Forks
503
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza inspeccionando las implementaciones personalizadas de FindPackageName.cmake mencionadas en el issue, especialmente el ejemplo de yaml-cpp, y compara sus guards de PackageName_ROOT con la documentación de CMake sobre find_package. Determina si el guard es intencionado y aclara el comportamiento esperado; la finalización debería resolver la cuestión planteada en el issue.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cmake, cpp
Área
build-system
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.