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

Aperta
#2,185 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cmake, cpp
Ambito
build-system

Direzione di ricerca

Inizia ispezionando le implementazioni personalizzate di FindPackageName.cmake menzionate nell’issue, in particolare l’esempio yaml-cpp, e confronta i relativi guard PackageName_ROOT con la documentazione di CMake su find_package. Determina se il guard è intenzionale e chiarisci il comportamento previsto; il completamento dovrebbe risolvere la questione sollevata nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 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.

Lingua principale
C++
Stelle
2.1k
Fork
513
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AcademySoftwareFoundation/OpenColorIO

Tutte le issue di AcademySoftwareFoundation/OpenColorIO

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.