Skip to content
Open
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
14 changes: 12 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ endif()


if (WITH_EXAMPLE_HEIF_VIEW)
find_package(SDL2 NO_MODULE)
find_package(SDL2 COMPONENTS SDL2 SDL2main NO_MODULE)

if (SDL2_FOUND)
add_executable(heif-view ${getopt_sources}
Expand All @@ -76,7 +76,17 @@ if (WITH_EXAMPLE_HEIF_VIEW)
sdl.hh
common.cc
common.h)
target_link_libraries(heif-view PRIVATE heif SDL2::SDL2main SDL2::SDL2)
target_link_libraries(heif-view PRIVATE heif)
target_include_directories(heif-view PRIVATE ${libheif_SOURCE_DIR})
Copy link
Contributor

@kmilos kmilos Sep 1, 2025

Choose a reason for hiding this comment

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

Why is this new explicit addition needed? AFAICT, the heif target should already carry over its include path definitions... Is something not working?

Copy link
Member Author

Choose a reason for hiding this comment

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

This got removed in 56e85c0 in the switch to the SDL2 components but is there for the other example apps, so I figured it might have been removed by accident.

Copy link
Contributor

Choose a reason for hiding this comment

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

it might have been removed by accident

It looks like it indeed, but it shouldn't be needed IMHO. It'd be interesting to see if it could also be removed elsewhere in a separate commit...

if (TARGET SDL2::SDL2main)
target_link_libraries(heif-view PRIVATE SDL2::SDL2main)
endif()
if (TARGET SDL2::SDL2)
target_link_libraries(heif-view PRIVATE SDL2::SDL2)
else()
target_include_directories(heif-view PRIVATE ${SDL2_INCLUDE_DIRS})
target_link_libraries(heif-view PRIVATE ${SDL2_LIBRARIES})
endif()
install(TARGETS heif-view RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif ()
endif ()
Expand Down
Loading