Hi,

I am looking for a way to share an archive of a partially compiled project to speedup compilation time and configuration hassle for the users.

I have a project that works in two steps.
First a source generator is built (based on clang) and generates some extra source files based on the existing source files. Then the normal compilation process takes places, building the application from both original and generated sources.

Here is a pseudo-Makefile.

    application: $GENERATED_SOURCES $SOURCES
        cc $^ -o $@

    $GENERATED_SOURCES: generator $SOURCES
        # generate more sources
        generator $SOURCES

    generate: $GENERATED_SOURCES

    generator: generator.cc clang(external) llvm(external)
        cc $< -o $@ -lclang -lllvm

Of course, all the project is using CMake.

Now, is it possible to distribute a source archive with the generated sources, in such a way that any user unpacking the archive and running cmake would not have to generate the extra sources ?

This would be useful because
i) the project is tricky to configure and
ii) the generated sources are not dependent on the user config, so building the generator is just useless computation time on the user.

The ideal scheme would be something like

    [developper]
    $ cmake -DCLANG=config
    $ make generate
    $ make package_source

    [user]
    $ unpack
    $ cmake -DUSER=config
$ make # builds only the application, reusing the shipped generated sources.
    $ make install

... but when the user runs cmake, he overwrites the generated Makefiles and the extra sources are generated again.

Any idea ?

layus.

--

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

Reply via email to