bookmark - Organizing C++ Project Files For Large Projects (source code, header, makefiles)

Organizing C++ Project Files For Large Projects - (source code, header, makefiles)

 
 Discussion by Vyoma with 4 Replies.
 Last Update: November 28, 2008, 8:51 pm
 
bookmark - Organizing C++ Project Files For Large Projects (source code, header, makefiles)  
    
free web hosting
 
Is there any online resource or documentation I can look at, which gives standards or best-practices in terms of organizing the source code for C++ projects?

My day job has kept me away from C++ and into Java for quite some time now, and I see there has been a lot of work in terms of standardizing C++ during that time.

To illustrate, looking up Sun's documentation, I know that I should put my Java projects (for POJOs) as follows:
/src - source files ( containing more subfolder like /src/com/example for namespace of com.example.*)
/build - intermediate files used by Ant build.xml
/cfg - configuration and .property files
/lib - any third-party libraries used
/scripts - invokers for Linux/Unix boxes

Is there any similar standard being followed for C++ projects? I am thinking of working on a Gtkmm based project, and if my prototyping gives good results, I would put it out as OpenSource (GPL perhaps). Since it could potentially be used and developed upon by others, I want to make sure I follow the standards and do not do a bad start.

Fri Nov 28, 2008    Reply    New Discussion   


Everything is inside the makefile (or Makefile) file.
There are mainly "best practices" everybody know, and each time I have to put my nose inside I say "why did he not do like me ?"
However, I would say it differently :
- not /src, but /home/mythings/src
I would like to suggest you to see how a well-known opensource software distro is organized.
Have a look at imagemagick instructions here : http://www.imagemagick.org/script/install-source.php#unix
and download their source distro from here http://www.imagemagick.org/script/download.php
Download the source, and see how it's organized, and have a look at the makefile.
The best thing is to organize it the same way, in such a way that you simply have to untar, then make, and make install, and in case of error "make clean".

Fri Nov 28, 2008    Reply    New Discussion   

Ayaaa! I think I wrote it wrongly when I was showing what I was doing with my Java projects. When I said /src, I should have actually said, '/my-home-folder-path/java-workspace/specific-project/src'. Instead of '/lib', I should have said, '/my-home-folder-path/java-workspace/specific-project/lib' and so on. :rolleyes:

Hmmm - I think I will do that. Thanks for the imagemagick link. May be I will check out some other OpenSource projects too which are implemented in C++ (know of any?).

Fri Nov 28, 2008    Reply    New Discussion   

QUOTE (Vyoma)

May be I will check out some other OpenSource projects too (know of any?).
Link: view Post: 132065

Have a look at PostGreSQL, it's a nice implementation. I don't remember whether it's C or C++, but from the implementation point of view it's very nice.
For instance I appreciate the fact that the final test says "Sorry, you are the root user, you should not" and you simply have to restart everything as a standard Unix user ! :rolleyes:

Fri Nov 28, 2008    Reply    New Discussion   


Also have a look at httrack. It's a gnu licensed program, and the cpp source files are distributed inside the Crosoft Dodows end-users version.

Fri Nov 28, 2008    Reply    New Discussion   

Quickly Post to Organizing C++ Project Files For Large Projects (source code, header, makefiles) w/o signup Share Info about Organizing C++ Project Files For Large Projects (source code, header, makefiles) using Facebook, Twitter etc. email your friend about Organizing C++ Project Files For Large Projects (source code, header, makefiles) Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Password Function   Password Function (0) (2) C++ Namespace when to use them?  C++ Namespace when to use them?