Author Topic: C::B Project setup with multiple files  (Read 2502 times)

Offline kirash4

  • Multiple posting newcomer
  • *
  • Posts: 42
C::B Project setup with multiple files
« on: April 10, 2014, 04:19:10 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B Project setup with multiple files
« Reply #1 on: April 10, 2014, 06:36:16 am »
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!]

Offline kirash4

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: C::B Project setup with multiple files
« Reply #2 on: April 10, 2014, 09:57:33 am »
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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B Project setup with multiple files
« Reply #3 on: April 10, 2014, 07:56:08 pm »
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!]

Offline kirash4

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: C::B Project setup with multiple files
« Reply #4 on: April 10, 2014, 10:39:43 pm »
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.