alec101 / OSInteraction

Multi-monitors / HID handling / everything you need for an OpenGL application or game under Windows/Mac/Linux
23 stars 3 forks source link

File Structure Change #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

Initial discussion on #1

I think its beneficial to change the file structure now(at least headers) to make the use of the project as a lib more straightforward and practical.

The src and include conventions are pretty much everywhere i touched until now on (Not a lot of experience). I am a big fun of SFML structure: SFML altogh i am not sure about include/PROJECT-NAME src/PROJECT-NAME.

What i normally do for my projects both on windows and linux is the following:

I am pretty sure Makefile and Visual Studio files covers pretty much all users. but i am going to create another issue for this.

Also, i think a ready-to-go examples dir very attractive when i am testing a new shiny thing i just found.

alec101 commented 9 years ago

My concern about changing the dir structure is, that it should be done once and it should be set in stone from that point on, because changing it multiple times would be bad. Therefore, this should be not rushed.

My dir structure is kinda the same:

project

I kinda like the proposed directory change. Lemme lay down my thoughts:

The examples, are very nice... A proj file for each of them? so the user should only compile and run? dunno.

I'll sleep more on the matter, more input is welcome! [EDIT: formatting]

ghost commented 9 years ago

I agree this should not be rushed.

About "src" and "include" i think it will make the project look more familiar to people used to open-source but only that. I have a very high respect for standards but i dont mind it if you wanna take the project to a different path, it's still a standard, just a project-specific one.

"extlibs" or "extlib" are the libs that your project needs to use to work properly whereas lib is the compiled lib for the current project. For me at least, of course.

About the lib subdirectories, every single lib i have used till date only outputed libLIB-NAME.so and libLIB-NAME.a(if static) under linux and LIB-NAME.lib under windows for different architectures. I found it best to split them into folders. So a example Makefile would look something like this:

all: gcc -std=c++11 -Wall -pedantic -Iextlibs//include src/.cpp src/util/.cpp -o build/$(OS)-$(ARCH)/binary.bin -Lextlibs//lib/$(OS)-$(ARCH)/ -lLIB1 -lLIB2 -lLIB3

With this line i referenced all headers for all the libs my project depends on and their "libfiles" since the name of the lib is the same on all Archs. This pseudo code can compile the project in every single platform and arch.

alec101 commented 9 years ago

Updated everything. If everything is ok... maybe the project dirs can be prj.vstudio / prj.nbeans / prj.blabla.

ghost commented 9 years ago

The project dirs sounds good if you insist in providing more than a visual studio and a makefile (I'am ok with that)

Just one more thing, the extlib dir should be structed like

Right now DirectX headers are on {$root}/include

I will commit some examples today after i learn a bit more of the API.

alec101 commented 9 years ago

done

ghost commented 9 years ago

Aww yeah! Closing this one.