Organization of files in Code Blocks

只谈情不闲聊 提交于 2019-12-02 23:53:06
hewi

large projects organisation

If you are creating a new project, coding a new software application or want to refactor existing code, it's a good to properly structure your project. While there is probably hundreds of ways to structure and while there are many thing to consider, here I would like to give you one possible approach which has really worked for me over and over. This example/proposal is the summary of the years of research I have done regarding this topic, so it's not just 'an idea'

There are three 'main' issues you definitely need to address when organising a project:

Medium to large projects, not to say all projects, should be version controlled (GIT as an example).

medium to large projects, not to say all projects, should be maintained by a project generator (Cmake as an example).

It would be impossible, for a medium to large project, to keep all files in the same physical directory. It is even strongly discouraged (by several guidelines including linux kernel). You should organize these files in a physical logical manner.

An example physical projects file structure would be:

~example/environment$project tree .
.
|- code
     |- core
     |- extern
|- docs
|- tests
     |- core_tests
     |- extern-tests
|- ...

This, unfortunately in code::blocks, means you will have to include all your project physical folders to the search paths.

You can organize your files inside code::blocks in any way you want, virtually too, but if your physical structure is logical, your project should be intuitive to browse!

code::blocks does not allow to include virtual paths.

hope this helps

KR

Hewi

In one of my projects in Code::Blocks I use different folders in my source folder; client, common and server.

I then have different compile targets, so that the client compile target will use the source files found in client and common, and the server compile target will use the source files found in server and common.

Not sure if that's what you're after but here is a picture of how my project looks like:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!