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

David Cole david.cole at kitware.com
Tue Jan 24 07:10:56 EST 2012


On Tue, Jan 24, 2012 at 1:40 AM, james <james at mansionfamily.plus.com> wrote:
> 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
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

Unlike rc and C++, we have not defined a "language" for IDL files.
That's why it doesn't work out of the box for the NMake Makefiles (or
any other makefile) generator. Sounds like a shortcoming in the
"support for IDL files" that we added, only considering Visual Studio
users as the primary target audience.

So... the answer to your question is that it probably doesn't work
with NMake Makefiles, at least for now. Further work required...


:-(

Sorry,
David


More information about the CMake mailing list