[CMake] some dependency issues

Javier Gonzalez javierggt at yahoo.com
Fri Sep 28 11:31:13 EDT 2007


Hi all,

I have a couple of comments/questions:

1.- I have a bunch of tests that I expect many people will not run all
the time so I excluded them from the 'all' target using EXCLUDE_FROM_ALL.
 The problem then was that when I did 'make test', the tests were not
build. I thought that dependency would be handled by ADD_TEST and when I
would do 'make test' it would then buil all the tests, but no. I then
tried using ADD_DEPENDENCIES(test ${MY_TEST_NAME}) only to discover that
there is no such target 'test' so I don't  know how to solve this.


2.- I have two subdirectories in my project: Utilities and Framework,
each with a target library. The second library depends on the first one.
The first library is small and the second one is very large. If I make a
small change in Utilities/CMakeLists.txt (remove white space, let's say)
then the thing goes and builds _everything_ in Utilities when I type
'make'. I could understand that although I think standard sources (like
.cc files) should be handled properly, if the source didn't change and
the dependencies are the same as before then it should not be re-built.
What I definitely don't understand is that it also builds everything in
the Framework directory! This is specially annoying since the directory
is large and there is no way anything that happened in the other
directory could affect it, the only dependency is through the library
and at most what I would expect is that the Framework library is linked
again.

What is happening? am I missing something? are these 'features' of
cmake? any idea on how to solve the problems?

I have a smaller project where the second issue doesn't occur (and I
still have two directories similarly structured). I will check what
makes the difference but any input will be appreciated!

Javier


More information about the CMake mailing list