[CMake] Dependencies to generated file across libraries

Jens Auer jensa at miltenyibiotec.de
Mon Jan 25 09:00:35 EST 2010


Hi,

I am trying to port a project from VC++ to a cmake build-system.
Unfortunately, the project has a little problem: There are several
libraries and some of them generate files using uic (Qt3). Cmake can
handle this pretty well, but in one case, there are two libraries which
include generated headers from each other:
/ Project(projectName)
/lib1
 File1.ui
 (GeneratedHeader1.h)
 Header2.h
 add_library(...)
/lib2
 File2.ui
 (GeneratedHeader3.h)
 Header4.h
 add_library(...)

The GeneratedHeader1.h and GeneratedHeader3.h are created by QT_WRAP_UI.
Header2.h includes lib2/GeneratedHeader3.h and Header4.h includes
lib1/GeneratedHeader1.h. This creates a circular dependency between the
projects, but it would be possible to just generate the headers before
processing one project, but cmake seems to not detect such file-based
dependencies between sub-directories. When I try to build the project,
the compiler fails to find the missing library. Is there a way to have
specify the dependency  manually? I tried the OBJECT_DEPENDS source file
property, but this has not changed the build process.


More information about the CMake mailing list