From 0031b81c7873ebc64da93fb8e099e29853f579c0 Mon Sep 17 00:00:00 2001 From: Nordup Date: Sun, 3 Mar 2024 16:22:25 +0100 Subject: [PATCH] CMake: Replace deprecated protobuf_generate_cpp() --- src/proto/CMakeLists.txt | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/proto/CMakeLists.txt b/src/proto/CMakeLists.txt index e146495..0c72234 100644 --- a/src/proto/CMakeLists.txt +++ b/src/proto/CMakeLists.txt @@ -5,9 +5,6 @@ find_package(Protobuf REQUIRED) -protobuf_generate_cpp(TCP_CPP TCP_HPP "MumbleTCP.proto") -protobuf_generate_cpp(UDP_CPP UDP_HPP "MumbleUDP.proto") - add_library(Proto OBJECT) target_disable_warnings(Proto) @@ -19,17 +16,14 @@ target_include_directories(Proto set_target_properties(Proto PROPERTIES UNITY_BUILD OFF) -target_sources(Proto - PRIVATE - ${TCP_CPP} - ${UDP_CPP} - # Marking the headers as PUBLIC causes CMake's configure step to fail. - # The files are generated during the build step. - ${TCP_HPP} - ${UDP_HPP} -) - target_link_libraries(Proto PRIVATE protobuf::libprotobuf ) + +protobuf_generate( + TARGET Proto + PROTOS + "MumbleTCP.proto" + "MumbleUDP.proto" +)