[CMake] Make install in subdirs (cmake newbie)
Jörg Schlichter
schlicht at usm.uni-muenchen.de
Wed Mar 16 04:37:13 EDT 2011
Hi!
I started to use cmake (and I like it), but I am now confronted with a
problem I cannot to solve:
We have a layout of our software tree looking more or less like this:
|
|--public_headers
|--lib
|
|--src
|--project1
|--project2
|--...
project1, project2 etc. are some shared libraries (using Qt). During the
build process, these libraries should be installed to "lib", the headers
to "public_headers". The "public_headers" directory is searched by the
other projects during compilation for headers they need.
We did this so far with qmake, and it worked quiet well. (By the way,
changing this directory layout is not an option).
I tried to do this now with cmake, so I created a CMakeLists.txt in
directory src, which looks about like this:
...
SUBDIRS( project1, project2, ...)
In the project directories I have "real" CMakeLists.txt files describing
all the stuff needed for compilation and installation of a project.
If I do there a "cmake; make all install" all is compiled and installed
as it should be.
The problem is, it does not work if I do "cmake; make all install" in
the directory src. In this case "make all" is executed for all projects,
and afterwards "make install" is executed for all projects. However, if
project2 expects a header of project1 to be installed in
"public_headers", compilation of project2 will fail, because the
installation step of project1 was not yet executed.
Is there anything I can do to solve this problem?
Thanks
Joerg
More information about the CMake
mailing list