Author Topic: Creating projects by hand  (Read 2654 times)

Offline rjmarshall17

  • Single posting newcomer
  • *
  • Posts: 4
Creating projects by hand
« 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):

  • Create a subdirectory called HelloWorld
  • Move HelloWorld.cpp to HelloWorld/main.cpp
  • Create a HelloWorld/HelloWorld.cbp file - simply copy/edit an existing one
  • Copy an existing .layout file to: HelloWorld/HelloWorld.layout
  • Add a Project tag/entry to the Tutorial.workspace file - I'm trying to organize all of the projects into individual workspaces
  • Open Code::Blocks
  • Open the (modified by me) Tutorial.workspace file
  • Have Code::Blocks see all of my projects in the workspace

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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12069
    • Travis build status
Re: Creating projects by hand
« Reply #1 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.
(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 rjmarshall17

  • Single posting newcomer
  • *
  • Posts: 4
Re: Creating projects by hand
« Reply #2 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12069
    • Travis build status
Re: Creating projects by hand
« Reply #3 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?
(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 jarod42

  • Multiple posting newcomer
  • *
  • Posts: 82
Re: Creating projects by hand
« Reply #4 on: April 02, 2012, 10:29:27 am »
There are some command-line tool to generate project for several IDE.

for example, Premake can create C::B project.