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

Đang mở
#2,185 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
cmake, cpp
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra các triển khai FindPackageName.cmake tùy chỉnh được đề cập trong issue, đặc biệt là ví dụ yaml-cpp, và so sánh các guard PackageName_ROOT của chúng với tài liệu về find_package của CMake. Xác định liệu guard này có được chủ ý hay không và làm rõ hành vi được mong đợi; việc hoàn thành cần giải quyết câu hỏi được nêu trong issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
2.1k
Fork
513
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AcademySoftwareFoundation/OpenColorIO

Tất cả issue của AcademySoftwareFoundation/OpenColorIO

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.