vtkPVMessage_protobuf_compile.dir/build.make:61: *** target pattern contains no '%'. Stop.
The current master fails to build on Linux with VTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON:
$ cmake -DPARAVIEW_USE_VTKM=OFF -DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON .. && make vtkPVMessage_protobuf_compile
-- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found suitable version "3.7.0", minimum required is "3.4")
...
-- Configuring done
...
ParaViewCore/ServerImplementation/Core/CMakeFiles/vtkPVMessage_protobuf_compile.dir/build.make:61: *** target pattern contains no '%'. Stop.
make[2]: *** [CMakeFiles/Makefile2:17208: ParaViewCore/ServerImplementation/Core/CMakeFiles/vtkPVMessage_protobuf_compile.dir/all] Error 2
If we look at the faulty Makefile we can see that the protobuf::protoc target path is not properly expanded int the dependencies of the generated header:
ParaViewCore/ServerImplementation/Core/vtkPVMessage.pb.h: ../ParaViewCore/ServerImplementation/Core/vtkPVMessage.proto
ParaViewCore/ServerImplementation/Core/vtkPVMessage.pb.h: ../ParaViewCore/ServerImplementation/Core/protobuf::protoc
@$(CMAKE_COMMAND)
I checked that protoc is properly detected, in the cache:
Protobuf_PROTOC_EXECUTABLE:FILEPATH=/usr/bin/protoc
Then I made sure that the protobuf::protoc exists with some message commands.
From Thirdpartu/protobuf/CMakeLists.txt, protobuf-function.cmake defines paraview_protobuf_generate:
if (VTK_MODULE_USE_EXTERNAL_ParaView_protobuf)
set(protobuf_function_file "${CMAKE_CURRENT_SOURCE_DIR}/protobuf-function.cmake")
else ()
set(protobuf_function_file "${CMAKE_CURRENT_SOURCE_DIR}/vtkprotobuf/cmake/protobuf-function.cmake")
endif ()
When VTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON, it redirects to protobuf_generate from cmake's FindProtobuf.cmake:
macro (paraview_protobuf_generate)
protobuf_generate(${ARGN})
endmacro ()
else paraview_protobuf_generate replicates the logic in cmake using the custom ParaView::protoc target:
function(paraview_protobuf_generate)
include(CMakeParseArguments)
...