I am trying to port my plugin from python to cpp to get faster calculations with a “stable plugin without type exceptions”.
I got the kiapi libraries by compiling the kicad source code.
But I can’t use the associated header file because it’s full of errors, and it looks like the required protobuf header file isn’t missing.
The strangest thing is that he can’t parse the protobuf version, he has to use #include “google/protobuf/runtime_version.h” before the kiapi header file, and if he compiles at that point, although he won’t throw an (
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
) error, he’ll get tons of syntax errors.
I tried generating the kiapi source and header files separately using protoc command line, again lots of errors and no way to compile it into a library.
Since it compiles in the kicad source, that proves that the kiapi header files are fine. How do I configure my project to use these headers properly?
The package manager I use is conan.
And the project compiles fine without introducing kiapi headers anymore.
Currently my CMakeLists.txt :
cmake_minimum_required(VERSION 3.31)
project(KicadTools)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VS_GLOBALS "VcpkgEnabled=false")
set_property(GLOBAL PROPERTY KICAD_CMAKE_MODULE_PATH "E:/Sources/kicad/cmake")
include_directories(KiApi)
add_subdirectory(DiffGen)
link_libraries(KiApi/kiapi.lib)
I don’t want to continue developing plugins in Python, due to the nature of the language I have to put more effort into making sure that the types of the runtime function parameters are correct, and the type annotations that are everywhere. With cpp I don’t need to care about the correct type of parameter types.