<div dir="ltr">I have a very similar situation at work to yours. We build a generator which produces source files, but we don't know the set of source files that will be produced until after the generator has been run. The solution that is working for us is documented here:<div><br></div><div><a href="http://stackoverflow.com/a/36084786/1938798">http://stackoverflow.com/a/36084786/1938798</a><br></div><div><br></div><div>It's a little more involved than you probably want, but we've been using it for close to a year now and it is serving us well.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 6:57 AM, Jeandet Alexis <span dir="ltr"><<a href="mailto:alexis.jeandet@member.fsf.org" target="_blank">alexis.jeandet@member.fsf.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#ffffff" text="#2e3436" link="#2a76c6" vlink="#2e3436"><div>Hi,</div><div><br></div><div>I play with CMake on PythonQt build. I faced a chalenge:</div><div><br></div><div>PythonQt is composed of:</div><div> 1)The generator which wrap Qt api(parses Qt sources to produce cpp/python wrappers)</div><div> 2)The Lib (main engine)</div><div> 3)The wrappers generated by 1)</div><div><br></div><div>The chalenge was to build in this order:</div><div> 1) build generator</div><div> 2) generate from generator wrappers </div><div> 3) build Lib</div><div> 4) build wrappers</div><div><br></div><div>My issue was to build wrappers from generator output since I can't predict how many files it will produce. And what I understood is that Glob can only be used at config time and I cant use *.cpp as sources.</div><div><br></div><div>So my basic solution was to build generator and call it at config time using ExternalProject and execute_process:</div><div><a href="https://github.com/jeandet/PythonQt/blob/cmake-clean/cmake/generated_cpp.cmake" target="_blank">https://github.com/jeandet/<wbr>PythonQt/blob/cmake-clean/<wbr>cmake/generated_cpp.cmake</a></div><div>Then build src and wrapper normally.</div><div>I'm a CMake beginner but I feel that this solution is ugly and it slows down config time.</div><div><br></div><div>Did I miss something? </div><div><br></div><div>Best regards,</div><div>Alexis.</div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div></div></div></div></div></div></div>
</div>