Fix build

https://bugs.gentoo.org/912853
https://bugs.gentoo.org/947632

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 010191b..57163b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,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)
diff --git a/ext/libclementine-remote/CMakeLists.txt b/ext/libclementine-remote/CMakeLists.txt
index 115d1f4..717d76c 100644
--- a/ext/libclementine-remote/CMakeLists.txt
+++ b/ext/libclementine-remote/CMakeLists.txt
@@ -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
 )
 
diff --git a/ext/libclementine-spotifyblob/CMakeLists.txt b/ext/libclementine-spotifyblob/CMakeLists.txt
index 7a73b14..072fe60 100644
--- a/ext/libclementine-spotifyblob/CMakeLists.txt
+++ b/ext/libclementine-spotifyblob/CMakeLists.txt
@@ -7,12 +7,12 @@ set(MESSAGES
   spotifymessages.proto
 )
 
-protobuf_generate_cpp(PROTO_SOURCES PROTO_HEADERS ${MESSAGES})
-
 add_library(clementine-spotifyblob-messages STATIC
-  ${PROTO_SOURCES}
+  ${MESSAGES}
 )
 
+protobuf_generate(TARGET clementine-spotifyblob-messages LANGUAGE cpp)
+
 target_link_libraries(clementine-spotifyblob-messages
   libclementine-common
 )
diff --git a/ext/libclementine-tagreader/CMakeLists.txt b/ext/libclementine-tagreader/CMakeLists.txt
index 8a0a944..fc2d6e6 100644
--- a/ext/libclementine-tagreader/CMakeLists.txt
+++ b/ext/libclementine-tagreader/CMakeLists.txt
@@ -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
 )
 
