I am trying out the Lead Tools SDK for a Linux based OCR embedded project. In the demo for the OCR portion there is a make file and the project I am trying to integrate it with uses CMake. I wrote a CMake equivalent for integration:
Just to see if it was possible on my current project, I tried to generate C++ code files from their .proto definitions whenever CMake ran. To do this, I added a few lines to the CMakeLists.txt file of the project. The idea is to use execute_process to call protoc and generate the files in the appropriate folder in the solution.
First, file(GLOB …) is used to set all of the .proto files into an iterable variable. Then, variables are setup for the proto_path and cpp_out variables.
Finally, we want to add the .pb.h and .pb.cc files to a variable for the final build. To do so, use file(GLOB …) again to search for all appropriate files.