Skip to content

Commit

Permalink
Depend on protobuf using its cmake config
Browse files Browse the repository at this point in the history
FindProtobuf provided by CMake forgets that it should depend on libabsl,
and link fails.

This change makes it to use files provided by Protobuf library, which
don't miss that important detail. That also required switch from
protobuf_generate_cpp() to protobuf_generate() because that's the
function which it has. FindProtobuf.cmake also provides
protobuf_generate() but only since CMake 3.13.

Fix #7272
  • Loading branch information
DarthGandalf committed Jan 7, 2025
1 parent e7e530e commit b7af93c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ endif(OPENGL_FOUND)
find_package(Boost REQUIRED)
find_package(Gettext REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Protobuf REQUIRED)
find_package(protobuf REQUIRED)
find_package(FFTW3)
find_package(ALSA)
if (NOT APPLE)
Expand Down
8 changes: 4 additions & 4 deletions ext/libclementine-remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ set(MESSAGES
remotecontrolmessages.proto
)

protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})

add_library(libclementine-remote STATIC
${PROTO_SOURCES}
${MESSAGES}
)

protobuf_generate(TARGET libclementine-remote LANGUAGE cpp)

target_link_libraries(libclementine-remote
${PROTOBUF_LIBRARY}
libclementine-common
protobuf::libprotobuf
)

8 changes: 4 additions & 4 deletions ext/libclementine-tagreader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ optional_source(HAVE_GOOGLE_DRIVE

qt5_wrap_cpp(MOC ${HEADERS})

protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})

add_library(libclementine-tagreader STATIC
${PROTO_SOURCES}
${MESSAGES}
${SOURCES}
${MOC}
)

protobuf_generate(TARGET libclementine-tagreader LANGUAGE cpp)

target_link_libraries(libclementine-tagreader
${PROTOBUF_LIBRARY}
libclementine-common
protobuf::libprotobuf
)

0 comments on commit b7af93c

Please sign in to comment.