I am currently converting some legacy build system based on Perl scripts and qmake files to CMake, and came across the following issue:
In our C++ code, we include a file
FooBar.h, but there is only a
FooBar.mc file in the sources. When looking at the Perl scripts, the
FooBar.mc file is processed as follows:
mc FooBar.mc rc -r -fo FooBar.res FooBar.rc link -nologo -dll -noentry /MACHINE:X86 -out:FooBar.dll FooBar.res
If I’m correct, the header file is a by-product of the first step (using the Message Compiler
Now my question is how I do all this in my
CMakeLists.txt file. I tried simply adding the
FooBar.mc file to my list of sources in my
add_library command as follows:
add_library(SomeLib SHARED .... FooBar.mc .... )
but that didn’t work.
Any hints to point me in the right direction are highly appreciated!