I'm using [protocol buffers](https://code.google.com/p/protobuf/) for data serialization in my C++ application. I would like to add the invokation of the `protoc` code generator in my [premake](http://industriousone.com/premake) build script (thus ensure the up-to-date state of the generated classes and avoid the need to store generated source under version control). 

Even their [FAQ](http://industriousone.com/faqs#external_tools) has a question and answer about this, but the answer is very incomplete for me. Having the ability to call any lua function is great, but where exactly do I put that call? I need to run the protoc compiler before building either the application or the unit tests.