[Cmake] Cmake flexibility

Neil Killeen Neil.Killeen at atnf.csiro.au
Thu Mar 20 01:22:03 EST 2003


Thanks Amitha, Bill and Andy for your advice.

I think I can deal with LaTeX etc OK now from the example
in the FAQ.


On Tue, 18 Mar 2003, William A. Hoffman wrote:
> >
> >1) I have put Test (i.e. where the test programs and scripts go) under
> >the class implementation, rather than have a whole parallel
> >Testing directory (e.g. like in ITK).
> >
> >The trouble is that Cmake seems to like to make recurseive
> >makefiles.  What I'd like is make files in Module1 and Module1/Test
> >but not that the latter gets built wheneveer the former is built.
> >I.e. the programmer drops into Test when ready.   If I don't
> >use the SUBDIRS CMake command, no makefiles at all get
> >build in Test...
> >
> >How do I do this with cmake ?
>
> There is no way to have a sub directory with a makefile that is not
> recursed into by make.
> You could have a cmake option that controls the inclusion of the SUBDIR
> command,
> something like BUILD_TESTING.   The only other option is to separately run
> cmake
> on the Test directories and treat them like separate projects.
>
> If the Tests are part of the build, you can have cmake run the tests as
> well as build them
> with the ADD_TEST command.
>
>


It's really a programmer convenience.  The way I prefer to work
is that I develop my class, and make sure it builds.  Then
I work on the test program and make sure it builds and runs ok.

When I change the class, I do that until I am happy, then
attend to the test program.

So I don't particularly want the makefiles to build the test program(s)
every time I make a small change to the class (that would be an annoying
waste of time).  I'd like to control that myself.

It doesn't matter if we are talking about building the system
and running the test suite, its really during the development
phase.

I find it rather cumbersome to have a whole Testing
directory that mirrors the modules tree.   Then I have to keep
popping over there to build the test program rather than simply
going in and out of a subdirectory.

But it looks like that is the only practical solution
at this point (is this fundamental to CMAKE design ?)

As I understand it, CMAKE switches are presumably only
operative when I create the makefiles, not after.  i.e. I can't specify
somehow (like an environment variable) a  'make-time' variable
"BUILD_TESTS"  (which prevents the recursion).


regards
Neil








More information about the CMake mailing list