Skip to content

Commit

Permalink
Link system libwebp instead of Qt-s.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 13, 2023
1 parent 2440fc9 commit 491a7fd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion external/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ else()
lib/${qt_lib_prefix}qtlibpng
lib/${qt_lib_prefix}qtpcre2
)

endif()

set(qt_libs_list "")
Expand Down Expand Up @@ -279,7 +280,30 @@ INTERFACE
$<TARGET_FILE:desktop-app::external_zlib>
)

if (LINUX)
if (WIN32)
if (build_win64)
set(libwebp_release_folder x64)
else()
set(libwebp_release_folder x86)
endif()

set(webp_lib_loc ${libs_loc}/libwebp/out/$<IF:$<CONFIG:Debug>,debug,release>-static/${libwebp_release_folder}/lib)

target_link_libraries(external_qt
INTERFACE
${webp_lib_loc}/libwebp$<$<CONFIG:Debug>:_debug>.lib
${webp_lib_loc}/libwebpdemux$<$<CONFIG:Debug>:_debug>.lib
${webp_lib_loc}/libwebpmux$<$<CONFIG:Debug>:_debug>.lib
)
elseif (APPLE)
target_link_libraries(external_qt
INTERFACE
${libs_loc}/local/lib/libwebp.a
${libs_loc}/local/lib/libwebpdemux.a
${libs_loc}/local/lib/libwebpmux.a
${libs_loc}/local/lib/libsharpyuv.a
)
elseif (LINUX)
target_include_directories(external_qt SYSTEM
INTERFACE
${qt_loc}/mkspecs/linux-g++
Expand All @@ -304,6 +328,10 @@ if (LINUX)
xcb-util
xcb-render-util
xcb-keysyms
webpmux
webpdemux
webp
sharpyuv
)
if (TARGET Qt::WaylandClient)
target_link_optional_libraries(external_qt
Expand Down
2 changes: 1 addition & 1 deletion external/qt/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (NOT DESKTOP_APP_USE_PACKAGED)
set(qt_loc /usr/local/desktop-app/Qt-${qt_version})
endif()

set(CMAKE_PREFIX_PATH ${qt_loc})
set(CMAKE_PREFIX_PATH ${qt_loc} ${libs_loc}/local)
endif()

if (NOT DEFINED QT_VERSION_MAJOR)
Expand Down

0 comments on commit 491a7fd

Please sign in to comment.