LINUX.ORG.RU

История изменений

Исправление KivApple, (текущая версия) :

Логи с офтопика, как с самой ущербной в плане установки библиотек и утилит системы:

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/kiv/Projects/VoxelGameC/cmake-build-debug-mingw/host
Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotobuf.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotobuf.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotoc.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  protoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\protoc.exe
  Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.h" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/build-cmake/CMakeLists.txt
  c_bytes_field.cc
  c_enum.cc
  c_enum_field.cc
  c_extension.cc
  c_field.cc
  c_file.cc
  c_generator.cc
  c_helpers.cc
  c_message.cc
  c_message_field.cc
  c_primitive_field.cc
  c_service.cc
  c_string_field.cc
  protobuf-c.pb.cc
c1xx : fatal error C1083: Impossible d'ouvrir le fichier sourceя: 'C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc'я: No such file or directory [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Generation de code en cours...
mingw32-make[3]: *** [CMakeFiles\gen_voxel_protocol.dir\build.make:81: host/protobuf-c/protoc-gen-c.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:646: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:712: CMakeFiles/VoxelGameC.dir/rule] Error 2
mingw32-make: *** [Makefile:230: VoxelGameC] Error 2

Логи из-под Ubuntu в WSL:

-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/kiv/Projects/VoxelGameC/build/host
[ 44%] Built target libprotobuf
[ 89%] Built target libprotoc
[ 90%] Built target protoc
[ 90%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
Scanning dependencies of target protoc-gen-c
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_bytes_field.cc.o
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum_field.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_extension.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_field.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_file.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_generator.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_helpers.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message_field.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_primitive_field.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_service.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_string_field.cc.o
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/main.cc.o
[ 98%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o
c++: error: /mnt/c/Users/kiv/Projects/VoxelGameC/build/host/protobuf-c/protobuf-c/protobuf-c.pb.cc: No such file or directory
c++: fatal error: no input files
compilation terminated.
make[6]: *** [protobuf-c/CMakeFiles/protoc-gen-c.dir/build.make:252: protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:234: protobuf-c/CMakeFiles/protoc-gen-c.dir/all] Error 2
make[4]: *** [CMakeFiles/Makefile2:241: protobuf-c/CMakeFiles/protoc-gen-c.dir/rule] Error 2
make[3]: *** [Makefile:238: protoc-gen-c] Error 2
make[2]: *** [CMakeFiles/gen_voxel_protocol.dir/build.make:63: host/protobuf-c/protoc-gen-c] Error 2
make[1]: *** [CMakeFiles/Makefile2:769: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Повторю, проблема в том, что protobuf-c.pb.cc и protobuf-c.pb.h сгенерированы в ${CMAKE_BINARY_DIR}/protobuf-c, а не в ${CMAKE_BINARY_DIR}/protobuf-c/protobuf-c, которые прописаны в списке исходников исполняемого файла в CMake. Я привёл в своём предыдущем сообщении конткетный фрагмент CMakeLists.txt от protobuf-c, который за это отвечает.

Кстати, мой собственный CMakeLists.txt немного изменился, чтобы стать более кроссплатформенным, однако это сути не меняет и ошибка проявляется на всех платформах.

cmake_minimum_required(VERSION 3.12)
project(VoxelGameC-host)

set(BUILD_SHARED_LIBS OFF)
set(protobuf_BUILD_TESTS OFF)
add_subdirectory(lib/protobuf/cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf")

set(Protobuf_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/protobuf/src")
set(Protobuf_LIBRARIES libprotobuf)
set(Protobuf_PROTOC_LIBRARY libprotoc)
if(MSVC)
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/${CMAKE_BUILD_TYPE}/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
else()
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
endif()

add_subdirectory(../lib/protobuf-c/build-cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf-c")
add_dependencies(protoc-gen-c protoc)

Исправление KivApple, :

Логи с офтопика, как с самой ущербной в плане установки библиотек и утилит системы:

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/kiv/Projects/VoxelGameC/cmake-build-debug-mingw/host
Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotobuf.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotobuf.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotoc.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  protoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\protoc.exe
  Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.h" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/build-cmake/CMakeLists.txt
  c_bytes_field.cc
  c_enum.cc
  c_enum_field.cc
  c_extension.cc
  c_field.cc
  c_file.cc
  c_generator.cc
  c_helpers.cc
  c_message.cc
  c_message_field.cc
  c_primitive_field.cc
  c_service.cc
  c_string_field.cc
  protobuf-c.pb.cc
c1xx : fatal error C1083: Impossible d'ouvrir le fichier sourceя: 'C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc'я: No such file or directory [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Generation de code en cours...
mingw32-make[3]: *** [CMakeFiles\gen_voxel_protocol.dir\build.make:81: host/protobuf-c/protoc-gen-c.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:646: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:712: CMakeFiles/VoxelGameC.dir/rule] Error 2
mingw32-make: *** [Makefile:230: VoxelGameC] Error 2

Логи из-под Ubuntu в WSL:

-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/c/Users/kiv/Projects/VoxelGameC/build/host
[ 44%] Built target libprotobuf
[ 89%] Built target libprotoc
[ 90%] Built target protoc
[ 90%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
Scanning dependencies of target protoc-gen-c
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_bytes_field.cc.o
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum_field.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_extension.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_field.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_file.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_generator.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_helpers.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message_field.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_primitive_field.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_service.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_string_field.cc.o
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/main.cc.o
[ 98%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o
c++: error: /mnt/c/Users/kiv/Projects/VoxelGameC/build/host/protobuf-c/protobuf-c/protobuf-c.pb.cc: No such file or directory
c++: fatal error: no input files
compilation terminated.
make[6]: *** [protobuf-c/CMakeFiles/protoc-gen-c.dir/build.make:252: protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:234: protobuf-c/CMakeFiles/protoc-gen-c.dir/all] Error 2
make[4]: *** [CMakeFiles/Makefile2:241: protobuf-c/CMakeFiles/protoc-gen-c.dir/rule] Error 2
make[3]: *** [Makefile:238: protoc-gen-c] Error 2
make[2]: *** [CMakeFiles/gen_voxel_protocol.dir/build.make:63: host/protobuf-c/protoc-gen-c] Error 2
make[1]: *** [CMakeFiles/Makefile2:769: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Повторю, проблема в том, что protobuf-c.pb.cc и protobuf-c.pb.h сгенерированы в ${CMAKE_BINARY_DIR}/protobuf-c, а не в ${CMAKE_BINARY_DIR}/protobuf-c/protobuf-c, которые прописаны в списке исходников исполняемого файла в CMake. Я привёл в своём предыдущем сообщении конткетный фрагмент CMakeLists.txt от protobuf-c, который за это отвечает.

Кстати, мой собственный CMakeLists.txt немного изменился, чтобы стать более кроссплатформенным, однако это сути не меняет и ошибка проявляется на всех платформах.

cmake_minimum_required(VERSION 3.12)
project(VoxelGameC-host)

set(BUILD_SHARED_LIBS OFF)
set(protobuf_BUILD_TESTS OFF)
add_subdirectory(lib/protobuf/cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf")

set(Protobuf_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/protobuf/src")
set(Protobuf_LIBRARIES libprotobuf)
set(Protobuf_PROTOC_LIBRARY libprotoc)
if(MSVC)
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/${CMAKE_BUILD_TYPE}/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
else()
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
endif()

add_subdirectory(../lib/protobuf-c/build-cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf-c")
add_dependencies(protoc-gen-c protoc)

[]

Исходная версия KivApple, :

Логи с офтопика, как с самой ущербной в плане установки библиотек и утилит системы:

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/kiv/Projects/VoxelGameC/cmake-build-debug-mingw/host
Microsoft (R) Build Engine version 16.10.0+4242f381a for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotobuf.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotobuf.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  libprotoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\libprotoc.lib
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/host/lib/protobuf/cmake/CMakeLists.txt
  protoc.vcxproj -> C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf\Release\protoc.exe
  Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): warning MSB8065: Custom build for item "C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\CMakeFiles\260aaf6a09e9ebc725b68682e302be9a\protobuf-c.pb.cc.rule" succeeded, but specified output "c:\users\kiv\projects\voxelgamec\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.h" has not been created. This may cause incremental build to work incorrectly. [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Building Custom Rule C:/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/build-cmake/CMakeLists.txt
  c_bytes_field.cc
  c_enum.cc
  c_enum_field.cc
  c_extension.cc
  c_field.cc
  c_file.cc
  c_generator.cc
  c_helpers.cc
  c_message.cc
  c_message_field.cc
  c_primitive_field.cc
  c_service.cc
  c_string_field.cc
  protobuf-c.pb.cc
c1xx : fatal error C1083: Impossible d'ouvrir le fichier sourceя: 'C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protobuf-c\protobuf-c.pb.cc'я: No such file or directory [C:\Users\kiv\Projects\VoxelGameC\cmake-build-debug-mingw\host\protobuf-c\protoc-gen-c.vcxproj]
  Generation de code en cours...
mingw32-make[3]: *** [CMakeFiles\gen_voxel_protocol.dir\build.make:81: host/protobuf-c/protoc-gen-c.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:646: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:712: CMakeFiles/VoxelGameC.dir/rule] Error 2
mingw32-make: *** [Makefile:230: VoxelGameC] Error 2

Логи из-под Ubuntu в WSL:

[ 44%] Built target libprotobuf
[ 89%] Built target libprotoc
[ 90%] Built target protoc
[ 90%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
Scanning dependencies of target protoc-gen-c
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_bytes_field.cc.o
[ 91%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_enum_field.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_extension.cc.o
[ 93%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_field.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_file.cc.o
[ 94%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_generator.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_helpers.cc.o
[ 95%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_message_field.cc.o
[ 96%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_primitive_field.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_service.cc.o
[ 97%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/c_string_field.cc.o
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/mnt/c/Users/kiv/Projects/VoxelGameC/lib/protobuf-c/protoc-c/main.cc.o
[ 98%] Generating protobuf-c/protobuf-c.pb.cc, protobuf-c/protobuf-c.pb.h
[ 98%] Building CXX object protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o
c++: error: /mnt/c/Users/kiv/Projects/VoxelGameC/build/host/protobuf-c/protobuf-c/protobuf-c.pb.cc: No such file or directory
c++: fatal error: no input files
compilation terminated.
make[6]: *** [protobuf-c/CMakeFiles/protoc-gen-c.dir/build.make:252: protobuf-c/CMakeFiles/protoc-gen-c.dir/protobuf-c/protobuf-c.pb.cc.o] Error 1
make[5]: *** [CMakeFiles/Makefile2:234: protobuf-c/CMakeFiles/protoc-gen-c.dir/all] Error 2
make[4]: *** [CMakeFiles/Makefile2:241: protobuf-c/CMakeFiles/protoc-gen-c.dir/rule] Error 2
make[3]: *** [Makefile:238: protoc-gen-c] Error 2
make[2]: *** [CMakeFiles/gen_voxel_protocol.dir/build.make:63: host/protobuf-c/protoc-gen-c] Error 2
make[1]: *** [CMakeFiles/Makefile2:769: CMakeFiles/gen_voxel_protocol.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Повторю, проблема в том, что protobuf-c.pb.cc и protobuf-c.pb.h сгенерированы в ${CMAKE_BINARY_DIR}/protobuf-c, а не в ${CMAKE_BINARY_DIR}/protobuf-c/protobuf-c, которые прописаны в списке исходников исполняемого файла в CMake. Я привёл в своём предыдущем сообщении конткетный фрагмент CMakeLists.txt от protobuf-c, который за это отвечает.

Кстати, мой собственный CMakeLists.txt немного изменился, чтобы стать более кроссплатформенным, однако это сути не меняет и ошибка проявляется на всех платформах.

cmake_minimum_required(VERSION 3.12)
project(VoxelGameC-host)

set(BUILD_SHARED_LIBS OFF)
set(protobuf_BUILD_TESTS OFF)
add_subdirectory(lib/protobuf/cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf")

set(Protobuf_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lib/protobuf/src")
set(Protobuf_LIBRARIES libprotobuf)
set(Protobuf_PROTOC_LIBRARY libprotoc)
if(MSVC)
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/${CMAKE_BUILD_TYPE}/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
else()
	set(
			Protobuf_PROTOC_EXECUTABLE
			"${CMAKE_CURRENT_BINARY_DIR}/protobuf/protoc${CMAKE_EXECUTABLE_SUFFIX}"
			-I${Protobuf_INCLUDE_DIR}
	)
endif()

add_subdirectory(../lib/protobuf-c/build-cmake "${CMAKE_CURRENT_BINARY_DIR}/protobuf-c")
add_dependencies(protoc-gen-c protoc)

[]