On Sat, Aug 03, 2013 at 11:20:53AM +0100, Roger Leigh wrote:
>
> I am trying to cmake-ify a build where the bulk of the sources are
> generated. I have a tool (python script) which reads a set of
> templates and then generates many source and header files (~250).
> I don't know in advance what the source files will be--it's
> dependent upon the templates. I've done this:
>
> set(GEN_DIR gen)
> set(GENERATOR path/to/script)
> set(TEMPLATES template1 template2 template3)
>
> execute_process(COMMAND ${GENERATOR} -d -o ${GEN_DIR} ${TEMPLATES}
> OUTPUT_VARIABLE GENERATED_SOURCES)
string(REPLACE "\n" ";" GENERATED_SOURCES ${GENERATED_SOURCES})
seems to be the missing part here, which turns the multiline
string into a list of strings. I was expecting this to behave
like make's $(shell ...) but the additional transform step is
no big deal. All seems to be working well now!
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
signature.asc
Description: Digital signature
-- 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://www.cmake.org/mailman/listinfo/cmake
