[CMake] Adding explicit dependencies to a target

Tarjei Knapstad tarjei.knapstad at gmail.com
Thu May 8 03:16:53 EDT 2014


In our project we are generating code from CORBA IDL files by adding a
custom command that generates C++ code from the IDL files and a library
target that depends on the generated output. This works as expected,
however IDL supports include directives which are (naturally) not picked up
as dependencies by CMake. To give an example:

a.idl:
--------------------
#include "b.idl"
#include "c.idl"
---------------------

Here the file a.idl file includes b.idl and c.idl. The file a.idl is given
as input to the custom command that processes IDL files into C++, but if I
change b.idl or c.idl then the target is not rebuilt. Is it possible to add
b.idl and c.idl as explicit dependencies in some way so that my target is
rebuilt if these files change? I've made various attempts with
add_custom_target() and add_dependencies() as well as
set_source_files_properties() without any luck.

Regards,
--
Tarjei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140508/bdd3ea53/attachment.html>


More information about the CMake mailing list