News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

C::B Project setup with multiple files

Started by kirash4, April 10, 2014, 04:19:10 AM

Previous topic - Next topic

kirash4

Is there a way to configure a new project that will hold several console programs, each one to be compiled separately (as in each one is its own EXE file)? So for example, I want to have one project called MyProject and inside of that I'll have ConsoleProgram1.cpp, Program2.cpp, AnotherConsoleProg3.cpp, etc., etc. From there I can compile each one separately, or do a full project compile and build all of them?

Right now when I create a new (console) project, the first source file already present is main.cpp which I won't use anyway.

oBFusCATed

You can create many targets, and inlcude each file in a different target and then make a virtual target that includes all other targets. When you build the virtual target all targets will be built one after another.

About the main.cpp: either delete it, rename it or create an empty project.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

kirash4

Ok, so if I understand you correctly, I would go into Project -> Properties and select the Build Targets tab and add targets there? Even if all the targets are exactly the same setup except for the source file and compiled binary?

oBFusCATed

Yep, If you pass the exact same settings you can inherit them from the project. Check the Policy combo box in the Build options dialog.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

kirash4

Thank you very much. I managed to get this to work. it took me a moment to realize I needed to change the Build Target drop down for the one file I was actively working on, or change it to the virtual target (all) to have it compile all the files.