[CMake] What is the correct way to specify multiple OBJECT_DEPENDS for a given source file?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat May 19 16:40:19 EDT 2007


For my fortran source code I use the include statement a lot to specify common
blocks, physical constants, etc.  Thus, I need the fortran source to be
recompiled each time one of these included files is changed.

For a simple test case, I found that putting the included file into the
library sources works fine, but only if the included file is in the same
directory.

Thus, I am trying to use, e.g.,

set_source_files_properties(
coulomb.f
PROPERTIES
OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/include/constants.h
)

to get the dependencies set up correctly, and the above works in all
cases where there is just one include statement per source file.

However, when I specify multiple *.h include files to OBJECT_DEPENDS I
get the following cmake error:

SET_SOURCE_FILES_PROPERTIES called with incorrect number of arguments.

I have also tried multiple set_source_files_properties commands, but it
appears to only use the last one when you are specifying the same property
(OBJECT_DEPENDS).

So what is the correct way to set up source-file dependencies on files
in another directory?

I am using cmake-2.4.6 on a Linux (Debian sarge) platform.

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