Layout of an OGRE based project

Problems building or running the engine, queries about how to use features etc.
Post Reply
Dalfy
Gnoblar
Posts: 9
Joined: Mon Feb 14, 2005 1:14 pm

Layout of an OGRE based project

Post by Dalfy »

Hello everybody,

I am on the way of starting a project based on OGRE. I would like some tips on how 'skilled' developers layout their project source tree around OGRE.

Does they use a folder containing the whole project including all external library such as OGRE ?

Does the library does not appear in the source tree and are available in the system ?

I have think at something similar to :

Code: Select all

project
  src
  
   build
       bin 
       lib 
       share 
       ...
   vendor
       Ogre 
       ODE 
         ...
   data 
        mesh
        scene
        ... 
Thanks for your answering and sorry for my english writing mistakes.
Last edited by Dalfy on Mon Feb 14, 2005 2:13 pm, edited 1 time in total.
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

'Skilled' I don't know. But the way I do it is:

Code: Select all

Development
  +-ogrenew
  |  (Ogre's source and libs)
  +-MyProject
  |  +-bin
  |  |  +-debug
  |  |  +-release
  |  +-include
  |  +-media
  |  +-obj
  |  |  +-debug
  |  |  +-release
  |  +-scripts
  |  +-src
This way I keep my project and Ogre's source seperate. Still I need to copy over Ogre's DLLs into my own bin/debug and bin/release directories (in Windows), but that's not a big deal. You can take a look at YAT's source to see it in practice. For a release I would just take the contents of the bin/release directory, and then zip the media directory and put it in there too.

I found this to be a good way to do things. It requires a little setup to point to the right include and lib directories, but once it's done it works very well. Hth
Dalfy
Gnoblar
Posts: 9
Joined: Mon Feb 14, 2005 1:14 pm

Post by Dalfy »

Thanks for your answer.
So you don't manage a build dir outside of your project source ?
Have you work with an SCM using this layout ?
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Dalfy wrote:Thanks for your answer.
So you don't manage a build dir outside of your project source ?
No problem. No, I don't have a build dir, but the binaries end up in the bin/xxx directories, and temporary build files are in obj/xxx, so the source isn't filled with irrelevant files.
Dalfy wrote:Have you work with an SCM using this layout ?
What is an SCM? Source control management? I haven't used that before.
User avatar
Exsortis
Halfling
Posts: 41
Joined: Mon Feb 07, 2005 6:16 pm
Location: Palmdale
Contact:

Post by Exsortis »

@DWORD:

SCM = Source code management, i.e., CVS, Subversion, Perforce, etc.

@Dalfy:
Dalfy wrote:Thanks for your answer.
So you don't manage a build dir outside of your project source ?
Have you work with an SCM using this layout ?
DWORD's layout could work with SCM. Just don't add bin or obj to the repo. :shock: Personally, I keep my build products outside of the project's directory.
Dalfy wrote:Does they use a folder containing the whole project including all external library such as OGRE ?
You can put your 3rd-party libraries wherever you wish.
Dalfy wrote:Does the library does not appear in the source tree and are available in the system ?
Only if the library is yours and part of the project itself. Otherwise, you would keep it outside, and let others know who are using your project that those libraries are required to build your project.

-E
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Exsortis wrote:SCM = Source code management, i.e., CVS, Subversion, Perforce, etc.
Ah, ok. I use CVS but only as a client so far. :)
Exsortis wrote:DWORD's layout could work with SCM. Just don't add bin or obj to the repo. :shock: Personally, I keep my build products outside of the project's directory.
Yeah, I can see it could be a problem having those files in the project directory with respect to SCM. But if you are careful not to commit these files I think it would work well. That's how it's done with Ogre's CVS repository, I think.
Dalfy
Gnoblar
Posts: 9
Joined: Mon Feb 14, 2005 1:14 pm

Post by Dalfy »

There is no real problem for not storing unwanted files such as object or binary executable file format even if the build dir layout is inside of the project tree.

I think I will keep the library outside of the project but inside of the "working area" doing something like this in order to keep all the information together.

I think on using something similar to this in order to easly provide binary version of my project

Code: Select all

project_area
   project (SCM)
       src 
       include  
   build_target1
      bin 
      conf 
      lib 
      data (compiled) or shared or whatever name that fits well  
   build_target2
      bin 
      conf
      lib 
      data (compiled) 
   data (source) (SCM)
   vendor  
      OGRE_target1
      OGRE_target2
      ODE_target1
      ODE_target2 
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

you can also just add an .cvsignore file into your bin and obj directories to prevent unwanted files from being committed accidently.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
Emmeran
Goblin
Posts: 272
Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen
Contact:

Post by Emmeran »

my structure is this:

Code: Select all


Disk 2
  + Ogre
  |  (Ogre v0.1.1)
  +-Palaba
  |  +-src
  |  +-include
  |  +-Binary
  |  |  +-Debug
  |  |  |  +-Media
  |  |  |  |  +-Config
  |  |  |  |  |  (Config files for debug)
  |  |  +-Release
  |  |  |  +-Media
  |  |  |  |  +-Config
  |  |  |  |  |  (Config files for release)
  |  |  +-Media
  |  |  |  (Global media files etc.)
  |  +-Build
  |  |  (Build files etc.)
 
Post Reply