<div dir="ltr"><br><br>Hi, I&#39;m trying to add a special cmake rule to build google&#39;s protocol buffers, and I was hoping someone could help me do it.&nbsp; I&#39;ve broken down the details of the protocol compiler here, so all that&#39;s missing is a cmake expert.<br>
<div>
<br>I have some &quot;.proto&quot; files that live in the same directories as the source.&nbsp; I want to specify a rule that calls this:<br><br>protoc DIR/SOMEFILE.proto&nbsp; --cpp_out=SOMEDIR<br><br>SOMEDIR should probably be DIR/CMakeFiles/DIR.dir<br>

<br>this will generate<br>SOMEDIR/SOMEFILE.pb.h<br>SOMEDIR/<a href="http://SOMEFILE.pb.cc" target="_blank">SOMEFILE.pb.cc</a><br><br>I want to include SOMEFILE.pb.h in my source files and I want them to be found.<br>I want to compile and link <a href="http://SOMEFILE.pb.cc" target="_blank">SOMEFILE.pb.cc</a> automatically<br>

<br>what is the easiest set of rules that I can use to extend cmake to do this?<br><br>Thanks<br><br>Neil<br></div>
<br></div>