Basically, I have a program that generates a couple of .cpp
files, which are included in a Visual Studio project. What I want is to have my program then tell Visual Studio to build that project, now that the .cpp
files have been generated.
I can use system()
to call MSBuild
or devenv
to do it. Those are both misbehaving at the moment but I can make them work. But ultimately, what I really want is to interface with Visual Studio/MSBuild directly in my C++ code, so I could do things like have it return the path to the output to me directly, or what have you.
Is there any way to do that? Every time I do a search on "building a Visual Studio project within C++" or similar, of course, I just get basic tutorials on setting up a project and building it through the IDE (or, at best, through the command line).