[CMake] Adding dependency using set_source_files_properties

Jens Mueller jens.k.mueller at gmx.de
Tue Aug 31 15:00:10 EDT 2010


Hi,

I've been trying to add manual dependencies using
set_source_files_properties. I know that I can add a dependency like
this
SET_SOURCE_FILES_PROPERTIES(source_file.foo PROPERTIES OBJECT_DEPENDS
/path/to/some_depend_file.bar)
in a CMakeLists.txt.

In my case, I want to add support for a new language. I have working
code that finds the compiler for the language. Further the compiler can
generate a list of depended files.
But how do I add these dependencies? I don't want to add it in each
project's CMakeLists.txt since it's redundant. Can I add this somewhere
else such that it automatically works for each source file for that
language?

I searched the list's archive for "gcc -M" and read some posts about
using gcc's dependency scanner instead of CMake's built-in one. But
I couldn't figure out how to do this. Any ideas?

Jens


More information about the CMake mailing list