Error linking against protoc generated object libray

I’m trying to get the Protobuf Tutorial to build and cannot figure out how to link against the protoc generated library
I’m running cmake version 3.22.1 on Ubuntu
The root cmake looks like this

cmake_minimum_required(VERSION 3.14)

project(ProtobuffTutorial LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Protobuf)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Protobuf)

add_subdirectory(proto)

add_executable(ProtobuffTutorial
  main.cpp
)

target_include_directories(ProtobuffTutorial PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")

target_link_libraries(ProtobuffTutorial
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Protobuf
    Proto
)

include(GNUInstallDirs)
install(TARGETS ProtobuffTutorial
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

The file in proto looks like this

INCLUDE(FindProtobuf)

FIND_PACKAGE(Protobuf REQUIRED)

include_directories(${Protobuf_INCLUDE_DIR})

protobuf_generate_cpp(PROTO_SRC PROTO_HEADER message.proto)

ADD_LIBRARY(Proto
    ${PROTO_HEADER}
    ${PROTO_SRC}
)
target_link_libraries(Proto PUBLIC ProtoLib)

target_sources (Proto PRIVATE
    message.proto
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

target_include_directories(Proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

The cmake build works and generates/compiles the proto file but when I try to link I get

12:22:19: Running steps for project ProtobuffTutorial...
12:22:19: Starting: "/home/llist/Qt/Tools/CMake/bin/cmake" --build /home/llist/QtProjects/build-ProtobuffTutorial-Desktop_Qt_6_6_1_GCC_64bit-Debug --target all
[1/8 237.8/sec] Running cpp protocol buffer compiler on message.proto
[2/8 119.8/sec] Automatic MOC and UIC for target Proto
[3/8 106.1/sec] Building CXX object proto/CMakeFiles/Proto.dir/Proto_autogen/mocs_compilation.cpp.o
[4/8 5.4/sec] Building CXX object proto/CMakeFiles/Proto.dir/message.pb.cc.o
[5/8 6.6/sec] Automatic MOC and UIC for target ProtobuffTutorial
[6/8 7.8/sec] Building CXX object CMakeFiles/ProtobuffTutorial.dir/ProtobuffTutorial_autogen/mocs_compilation.cpp.o
[7/8 3.8/sec] Building CXX object CMakeFiles/ProtobuffTutorial.dir/main.cpp.o
[8/8 4.3/sec] Linking CXX executable ProtobuffTutorial
FAILED: ProtobuffTutorial 
: && /usr/bin/x86_64-linux-gnu-g++ -DQT_QML_DEBUG -g  proto/CMakeFiles/Proto.dir/Proto_autogen/mocs_compilation.cpp.o proto/CMakeFiles/Proto.dir/message.pb.cc.o CMakeFiles/ProtobuffTutorial.dir/ProtobuffTutorial_autogen/mocs_compilation.cpp.o CMakeFiles/ProtobuffTutorial.dir/main.cpp.o -o ProtobuffTutorial  -Wl,-rpath,/home/llist/Qt/6.6.1/gcc_64/lib:  /home/llist/Qt/6.6.1/gcc_64/lib/libQt6Protobuf.so.6.6.1  /home/llist/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6.6.1  -lProtoLib && :
/usr/bin/ld: cannot find -lProtoLib: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
12:22:21: The process "/home/llist/Qt/Tools/CMake/bin/cmake" exited with code 1.
Error while building/deploying project ProtobuffTutorial (kit: Desktop Qt 6.6.1 GCC 64bit)
When executing step "Build"
12:22:21: Elapsed time: 00:02.

I thought I followed the doc, but I obviously missed something

Thanks

I got it to link

root

cmake_minimum_required(VERSION 3.14)

project(ProtobuffTutorial LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Protobuf)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Protobuf)

add_subdirectory(proto)

add_executable(ProtobuffTutorial
  main.cpp
)

target_include_directories(ProtobuffTutorial PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")

target_link_libraries(ProtobuffTutorial
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Protobuf
    ${Protobuf_LIBRARIES}
    Proto

)

include(GNUInstallDirs)
install(TARGETS ProtobuffTutorial
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

proto

INCLUDE(FindProtobuf)

FIND_PACKAGE(Protobuf REQUIRED)

include_directories(${Protobuf_INCLUDE_DIR})

protobuf_generate_cpp(PROTO_SRC PROTO_HEADER message.proto)

ADD_LIBRARY(Proto
    ${PROTO_HEADER}
    ${PROTO_SRC}
)

target_sources (Proto PRIVATE
    message.proto
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

target_include_directories(Proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR})