Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rjmarshall17 on March 30, 2012, 09:20:46 pm

Title: Creating projects by hand
Post by: rjmarshall17 on March 30, 2012, 09:20:46 pm
Hi,

Let's say that I have a bunch of source files and I'd like to turn them all into projects. Is it possible to do the following (I'm on a Linux system, example filename: HelloWorld.cpp):


Is that possible? It would save me a bunch of pointing and clicking in order to add a bunch of projects via the GUI.

Thanks,

Rob
Title: Re: Creating projects by hand
Post by: oBFusCATed on March 30, 2012, 09:55:02 pm
Let's say that I have a bunch of source files and I'd like to turn them all into projects. Is it possible to do the following (I'm on a Linux system, example filename: HelloWorld.cpp):
It is possible to edit the cbp and workspace files (they are xmls), but this is unsupported by us, so you're on your own.

  • Copy an existing .layout file to: HelloWorld/HelloWorld.layout
Why would you edit a .layout file? It is generated automatically.

  • Add a Project tag/entry to the Tutorial.workspace file - I'm trying to organize all of the projects into individual workspaces
Why would you make N-workspaces with a single project in them? Workspaces are meant to combine multiple projects together.

p.s. If you want to edit files by hand you don't need an IDE, a text editor and make are just enough.
Title: Re: Creating projects by hand
Post by: rjmarshall17 on March 30, 2012, 10:19:01 pm
Hi,

Sorry, I guess I wasn't clear. I was creating a limited number of workspaces (at present only two), each with a bunch of projects in them.

The only reason I was copying (not editing, just copying) the .layout file was because I noticed that project directories had them. I assumed a project needed one in order to be "properly" set up.

And, when I tried this, I noticed that my "added by hand" projects did NOT show up in the workspace. So the state of the workspace must be kept some place else besides the .workspace file.

Just as a suggestion...when people are attempting to move a bunch of existing files/projects into Code::Blocks, it would be nice to have some script/tool that would make the job a little easier. What I ended up doing was adding each of the projects via the GUI, overwriting the .cbp file I had created, NOT overwriting the main.cpp file, and it seems happy now. I created a separate workspace for my other projects (several multi-file libraries) and that seems to work fine as well. But something I could have done in a couple of minutes via a script took significantly longer in the GUI.

Thanks,

Rob
Title: Re: Creating projects by hand
Post by: oBFusCATed on March 30, 2012, 10:58:43 pm
Just as a suggestion...when people are attempting to move a bunch of existing files/projects into Code::Blocks
What existing projects? VStudio project (in fact they are supported)? Eclipse projects? What?
Title: Re: Creating projects by hand
Post by: jarod42 on April 02, 2012, 10:29:27 am
There are some command-line tool to generate project for several IDE.

for example, Premake (http://industriousone.com/premake) can create C::B project.