File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ endif()
67
67
68
68
69
69
if (WITH_EXAMPLE_HEIF_VIEW)
70
- find_package (SDL2 NO_MODULE)
70
+ find_package (SDL2 COMPONENTS SDL2 SDL2main NO_MODULE)
71
71
72
72
if (SDL2_FOUND)
73
73
add_executable (heif-view ${getopt_sources}
@@ -76,7 +76,15 @@ if (WITH_EXAMPLE_HEIF_VIEW)
76
76
sdl.hh
77
77
common.cc
78
78
common.h)
79
- target_link_libraries (heif-view PRIVATE heif SDL2::SDL2main SDL2::SDL2)
79
+ target_link_libraries (heif-view PRIVATE heif)
80
+ if (TARGET SDL2::SDL2main)
81
+ target_link_libraries (heif-view PRIVATE SDL2::SDL2main)
82
+ endif ()
83
+ if (TARGET SDL2::SDL2)
84
+ target_link_libraries (heif-view PRIVATE SDL2::SDL2)
85
+ else ()
86
+ target_link_libraries (heif-view PRIVATE ${SDL2_LIBRARIES} )
87
+ endif ()
80
88
install (TARGETS heif-view RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} )
81
89
endif ()
82
90
endif ()
You can’t perform that action at this time.
0 commit comments