Hi all.
<div><br></div><div>I have a directory of .pkg files to be processed by tolua. This in turn generates a bunch of cpp files, which I then link into a library.</div><div><br></div><div>My problem right now is that, I would like to generate a project, where each .pkg is associated with a custom command, so that I in visual studio (for exampel) can "compile" each .pkg file individually.</div>
<div><br></div><div>I have managed to create a library, and to get all the generated cpp file associated to the library+a custom target command which is executed PRE_BUILD to the library.</div><div>But thats not quite what I would like. Because then I cant just compile one .pkg file if I edit it. Using the above approach, requires me to build the whole project, which compiles ALL .pkg files associated to it, not what I want. I want to setup a proper dependency chain, so that If a .pkg file is modified, the corresponding "generated"_xx.cpp is generated, and the project is linked.</div>
<div><br></div><div>So I guess Im looking for something like:</div><div><br></div><div>add_library(myLib theMain.cpp </div><div> generated_math.cpp </div><div> math.pkg </div><div>)</div><div><br></div><div><div>set_source_files_properties(generated_math.cpp GENERATED)</div>
</div><div><br></div><div>being able to tell CMake that .pkg files are treated in a certain way:</div><div>The command that I want to execute for each .pkg is:</div><div><br></div><div>tolua -o generated_math.cpp<span class="Apple-tab-span" style="white-space:pre">        </span>-n math<span class="Apple-tab-span" style="white-space:pre">        </span>math.pkg</div>
<div><br></div><div>So any hints on how to do this?</div><div>I can certainly do this in VisualStudio, adding .pkg files to the project, and setting the build events on it, but I need a portable solution...</div><div><br>
</div><div>/A</div>