[CMake] Generated files and dependencies

Łukasz Tasz lukasz at tasz.eu
Thu Jun 16 10:00:45 EDT 2011


Hi all,

I have one issue with organising dependencies between projects.


I have three projects,
   - first is application which contain static code of the application,
   - second is library which is contain code for the library,
   - third is library which generates the source code and headers, and
provide library.

First project is link against static library, and generated library.
Generated headers from third project are used by first and second
project.

the application project looks like (in a hudge simplification):
   project(application)
   add_subdirectory(librarygen)
   add_subdirectory(library)


   add_executable(application sources1..x)


My question is what is the common practice of creating dependencies?
e.g library project is not aware about how to generate the headers,
generated makefiles will try to run generation of librarygen and
compilation library at the same time, since it is wrong

the situation is changing when I manualy specify dependencies:
add_dependencies(library librarygen)

Is there any other mechanism inside cmake to manage dependencies
between cmake projects to files that will be generated?
What is the common practice with code generation?

thanks in advance,
Lukasz

-- 
Lukasz Tasz


More information about the CMake mailing list