Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cmake/modules/FindLibheif.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
include (FindPackageHandleStandardArgs)

find_path (LIBHEIF_INCLUDE_DIR
libheif/heif_version.h
libheif/heif_version-64.h
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
libheif/heif_version-64.h
NAMES libheif/heif_version.h libheif/heif_version-64.h

According to cmake docs, you can give several names to try.

HINTS
${LIBHEIF_INCLUDE_PATH}
ENV LIBHEIF_INCLUDE_PATH
Expand All @@ -30,7 +30,7 @@ find_library (LIBHEIF_LIBRARY heif
DOC "The directory where libheif libraries reside")

if (LIBHEIF_INCLUDE_DIR)
file(STRINGS "${LIBHEIF_INCLUDE_DIR}/libheif/heif_version.h" TMP REGEX "^#define LIBHEIF_VERSION[ \t].*$")
file(STRINGS "${LIBHEIF_INCLUDE_DIR}/libheif/heif_version-64.h" TMP REGEX "^#define LIBHEIF_VERSION[ \t].*$")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want something like

    if (EXISTS name_choice_1)
        set (heif_header name_choice_1)
    else if (EXISTS name_choice_2)
        set (heif_header name_choice_2)
    endif ()
    file(STRINGS ${heif_header_name} TMP REGEX "^#define LIBHEIF_VERSION[ \t].*$")

string(REGEX MATCHALL "[0-9.]+" LIBHEIF_VERSION ${TMP})
endif ()

Expand Down
Loading