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:
http://stackoverflow.com/a/36084786/1938798 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. On Wed, Mar 29, 2017 at 6:57 AM, Jeandet Alexis < alexis.jean...@member.fsf.org> wrote: > Hi, > > I play with CMake on PythonQt build. I faced a chalenge: > > PythonQt is composed of: > 1)The generator which wrap Qt api(parses Qt sources to produce cpp/python > wrappers) > 2)The Lib (main engine) > 3)The wrappers generated by 1) > > The chalenge was to build in this order: > 1) build generator > 2) generate from generator wrappers > 3) build Lib > 4) build wrappers > > 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. > > So my basic solution was to build generator and call it at config time > using ExternalProject and execute_process: > https://github.com/jeandet/PythonQt/blob/cmake-clean/ > cmake/generated_cpp.cmake > Then build src and wrapper normally. > I'm a CMake beginner but I feel that this solution is ugly and it slows > down config time. > > Did I miss something? > > Best regards, > Alexis. > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -- Craig Scott Melbourne, Australia https://crascit.com
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake