cmake midl compiler

Viewed 22

I am trying to use MIDL compiler with cmake and that's what I came to. In the similar questions people sujjest to use add_custom_command, but I suppose it is outdated since simply adding the IDL file to the list of files does the trick.

However there are problem with this approach:

  1. Output files are not added to the list of files, so the compiler doesn't compile them. 1.1. Adding files manually doesn't work because cmake can't find them (since they don't exist)
  2. Output files are created in the intermediate directory, where cmake doesn't really gives access to.
  3. It changes default names of the output files in the project settings (e.g. %(Filename).h instead of %(Filename)_i.h for header files).

So my question is did somebody encountered these issues and if so how to fix them?

Using add_custom_command is undesirable because Visual Studio doesn't treat it as a normal IDL file, so you have to setup everything manually.

0 Answers
Related