AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

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

オープン
#2,185 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
2.1k
フォーク
503
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、issueで言及されているカスタムFindPackageName.cmake実装、特にyaml-cppの例を調査し、それらのPackageName_ROOTガードをCMakeのfind_packageドキュメントと比較してください。そのガードが意図的なものかどうかを判断し、期待される動作を明確にしてください。完了時には、issueで提起された疑問が解決されている必要があります。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cmake, cpp
領域
build-system
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。