Skip to content

Commit

Permalink
Add alias for exiv2 target if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickziegler committed Feb 10, 2024
1 parent 8bc03c6 commit b7d9056
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mediacopier-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ find_package(exiv2 REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(spdlog REQUIRED)

# inspired by https://github.com/Exiv2/exiv2/commit/130064dc76d2494b6fd473b293f2f32d36eb88f3,
# needed here because package in Ubuntu 22.04 was not updated yet
if (NOT TARGET Exiv2::exiv2lib)
add_library(Exiv2::exiv2lib ALIAS exiv2lib)
endif()

pkg_check_modules(AVFORMAT REQUIRED libavformat libavutil)
pkg_check_modules(LIBJPEG REQUIRED libturbojpeg)

Expand Down Expand Up @@ -67,7 +73,7 @@ target_include_directories(${TARGET_NAME} PUBLIC
target_link_libraries(${TARGET_NAME} PRIVATE
"${AVFORMAT_LINK_LIBRARIES}"
"${LIBJPEG_LINK_LIBRARIES}"
exiv2lib spdlog::spdlog)
Exiv2::exiv2lib spdlog::spdlog)

if(${ENABLE_TEST})
add_subdirectory(test)
Expand Down

0 comments on commit b7d9056

Please sign in to comment.