Custom build rule in Visual Studio

4 posts / 0 new
Last post
Offline
Last seen: 6 years 5 months ago
Joined: 08/05/2014
Posts: 2
Custom build rule in Visual Studio

Hi everybody,

I have a bunch of IDLs (nearly 100), which is an easy job to do on Linux using a makefile. But now I have to use those IDLs in Visual Studio 2012 (C++). I don't like to add each and every single IDL file manually, defining the command line and the output, as it is done eg. in the Hello_idl example. Is there a way to define a build rule, so that I can simply add all my IDLs somewhere and Visual Studio does the rest?

Thanks in advance and best regards,

Dieter

Offline
Last seen: 5 months 2 weeks ago
Joined: 01/15/2013
Posts: 92

Hi Dieter,

Would a custom build step calling a BAT script work for you? In this link, you can find how to define a custom build tool or script to be executed, via the "Command Line" field.

Let me know if this helps.

Thanks,

Juanlu

Offline
Last seen: 6 years 5 months ago
Joined: 08/05/2014
Posts: 2

Hi Juanlu,

this is somehow what I'm currently doing. I have a batch job which does nothing more than looping over all IDL files. I call it on the command line. Furthermore I generated some XML fragments to put all the dependencies into my project in order to get all the generated stuff built.

This works fine for the moment. But when IDL changes, it gets errror-prone. Or, to be on the safe side, I have to call the batch job more often, which is a little bit time-consuming with this masses of IDL files, even with rtiddsgen2. And it does not solve the dependency problem in case of adding or removing an IDL file.

So what I'm aiming at, is the possibility to simply add the IDLs to the project and calling rtiddsgen and compiling the generated code is done by this custom rule or whatever. My hope is that someone in the community already was facing this "challenge".

Thanks anyway and best regards,

Dieter

jwillemsen's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 09/24/2013
Posts: 54

We are using MPC to generate the various make files and solutions. In the hand written mpc files we list all input files, the dependencies in MPC make sure the IDL files are correctly compiled when the input changes. For example, for the Shapes IDL file we are using this mpc project file.