[CMake] How to define dependencies? Problem with nmake builds.

james james at mansionfamily.plus.com
Tue Jan 24 01:40:50 EST 2012


My component source list includes:

     easyrtd.src/COMRtdInterface.cpp
     easyrtd.src/EasyRTD.rc
     easyrtd.src/EasyRTD.idl

and after fixing up the paths Visual Studio builds the project OK.

However, nmake does not - the RC compiler runs before MIDL.

It seems that there is a dependency that's missing.  This would seem to 
be the implied one from the TYPELIB statement in the RC file.

Is it enough to use OBJECT_DEPENDS on the rc file (treating the implied 
res file as an object) naming the tlb that would be output by midl?

Presumably I'd also have to declare that the idl file produces the tlb 
file, using OBJECT_OUTPUTS? (Or not?  This is only for Makefile 
generators, but how is the OBJECT_DEPENDS going to be handled in other 
cases?)

There seems to be an element of magic going on here rather than 
explicitly handling the midl/rc/link toolchain. I know Visual Studio 
tries to make this stff easy - but how does it work with nmake (and 
ideally the mingw toolchain too)?

James


More information about the CMake mailing list