[CMake] Problem with ADD_CUSTOM_COMMAND & ARGS

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Sep 16 16:58:25 EDT 2009


On 2009-09-16 16:27-0400 Eric Tellefsen wrote:

> My problem has to do with the ARGS section of the custom command.
> Specifically the 'legacy' Makefile uses an argument  --include-regex  
> "#../../XML/Types/##"  in order to remove this prefix from the generated HXX
> files, where applicable.
> 
> While everything works fine with the legacy Makefile, it does not seem to
> work in my CMake Makefile.  Everything works with the exception that some of
> the generated HXX files still contain the "../../Types/" prefix, which
> breaks the subsequent source compilation as the headers with the
> "#../../XML/Types/##" prefix cannot be found by the compiler.   I'm guessing
> that this problem has something to do with the value being passed to the
> option --include-regex is not tracking correctly but I'm not sure why.

Just as a general comment there is no need to guess at what CMake does.
You can find out the exact commands being executed by a make command
that has been configured by cmake by setting VERBOSE=1,
e.g.,

make VERBOSE=1 ...

Another complementary debugging technique is to use the CMake message command
(for example, in the middle of your macro) to make sure your CMake logic
is working like you expect.

Hope these general comments help you to narrow down exactly what is going on
and help you to make a really simple example of the problem you are
encountering which others can run to replicate your problem.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list