Uniform directory structure for both SDK and source release

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Uniform directory structure for both SDK and source release

Post by nikki » Wed Jan 21, 2009 10:23 am

Today on IRC, someone had a problem with the AppWizard because it was built for the SDK directory structure and he had the Ogre source one. The last time I checked on Windows, the SDK just had 'include' and 'lib' directories directly under the root Ogre directory, whereas in source the main headers were in 'OgreMain/include' and libraries got copied to 'lib' under root. This is understandable, because the source distribution also has the source code and it has to be a bit organised, we can't allow OgreMain, the PlugIns and the Tools to mix.

However, it would be nice to have a common directory structure between SDK and source release, so that AppWizards or build scripts don't have to bother which release one is using. You could have a post-build process to copy the headers over to 'include' under root or something, or may be you could think of something better. Under Linux, this isn't much of a problem since most people are going to build from source and install to /usr/local prefix anyway. On Windows, it could be a little frustrating.

If this discrepancy in the directory structure has a valid reason, I'm willing to agree if you explain it.
0 x

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: Uniform directory structure for both SDK and source release

Post by CABAListic » Wed Jan 21, 2009 11:00 am

Well, this is where the CMake build system would come to rescue. With it, you would basically build your own SDK, the source directory is no longer touched, and at the end you get a clean install directory of your choice. Any future SDK package would just be a copy of this install directory, so the structures would be exactly identical.
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Uniform directory structure for both SDK and source release

Post by jacmoe » Wed Jan 21, 2009 11:13 am

nikki wrote:Today on IRC, someone had a problem with the AppWizard because it was built for the SDK directory structure and he had the Ogre source one.
That's can't be a problem because there are AppWizards for both SDK and source. I guess that someone used the wrong wizard. :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Re: Uniform directory structure for both SDK and source release

Post by nikki » Wed Jan 21, 2009 12:06 pm

jacmoe wrote:
nikki wrote:Today on IRC, someone had a problem with the AppWizard because it was built for the SDK directory structure and he had the Ogre source one.
That's can't be a problem because there are AppWizards for both SDK and source. I guess that someone used the wrong wizard. :wink:
Ahh... I'm not familiar with the AppWizards because I never used them. :?
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Re: Uniform directory structure for both SDK and source release

Post by sinbad » Wed Jan 21, 2009 6:00 pm

The SDK is a different structure precisely because it's simplified. The source release *has* to have a deeper directory structure because it contains more. You can't flatten the source release, and making the SDK that structure would confuse people with a zillion empty directories.
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Re: Uniform directory structure for both SDK and source release

Post by nikki » Wed Jan 21, 2009 7:41 pm

sinbad wrote:The SDK is a different structure precisely because it's simplified. The source release *has* to have a deeper directory structure because it contains more. You can't flatten the source release, and making the SDK that structure would confuse people with a zillion empty directories.
I was thinking the same thing.

So how should build-scripts/project files be made independent of the release (SDK/source) of Ogre one uses? The problem is often seen in Visual C++ projects on Windows (like, the OgreBullet ones).
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Uniform directory structure for both SDK and source release

Post by jacmoe » Wed Jan 21, 2009 7:48 pm

You could do it by providing projects for SDK and source, or you could do it by providing one project with different configurations.
Or by a script which creates a project based on user input.
If you are using a build script generator like premake, bakefile or cmake, you don't have to worry about it, much.
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: Uniform directory structure for both SDK and source release

Post by CABAListic » Wed Jan 21, 2009 8:01 pm

nikki wrote:
sinbad wrote:The SDK is a different structure precisely because it's simplified. The source release *has* to have a deeper directory structure because it contains more. You can't flatten the source release, and making the SDK that structure would confuse people with a zillion empty directories.
I was thinking the same thing.

So how should build-scripts/project files be made independent of the release (SDK/source) of Ogre one uses? The problem is often seen in Visual C++ projects on Windows (like, the OgreBullet ones).
Because CMake has an additional INSTALL step which conventional Visual C++ projects don't provide. The project is built from the source tree into a specified build tree (the source tree is, in fact, never touched, not a single file is generated in there, unless you specify the source tree as the build tree). From there, all files you need for everyday use of Ogre (i. e. the compiled libraries, plugins, headers etc.) are copied to the install directory which would then basically become your Ogre installation that you can link your Ogre projects to. And this install directory *can* look like the SDK (or at least I don't see why it couldn't). Just try it, I'm looking for testers, anyway :)
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Re: Uniform directory structure for both SDK and source release

Post by nikki » Thu Jan 22, 2009 10:48 am

CABAListic wrote:
nikki wrote:
sinbad wrote:The SDK is a different structure precisely because it's simplified. The source release *has* to have a deeper directory structure because it contains more. You can't flatten the source release, and making the SDK that structure would confuse people with a zillion empty directories.
I was thinking the same thing.

So how should build-scripts/project files be made independent of the release (SDK/source) of Ogre one uses? The problem is often seen in Visual C++ projects on Windows (like, the OgreBullet ones).
Because CMake has an additional INSTALL step which conventional Visual C++ projects don't provide. The project is built from the source tree into a specified build tree (the source tree is, in fact, never touched, not a single file is generated in there, unless you specify the source tree as the build tree). From there, all files you need for everyday use of Ogre (i. e. the compiled libraries, plugins, headers etc.) are copied to the install directory which would then basically become your Ogre installation that you can link your Ogre projects to. And this install directory *can* look like the SDK (or at least I don't see why it couldn't). Just try it, I'm looking for testers, anyway :)
That's a bit like make install and the configure script prefix, isn't it? ;)
0 x

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: Uniform directory structure for both SDK and source release

Post by CABAListic » Thu Jan 22, 2009 10:54 am

Yes, it is - in fact, on Linux it *is* make install ;)
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Re: Uniform directory structure for both SDK and source release

Post by jacmoe » Thu Jan 22, 2009 11:13 am

CABAListic wrote:Yes, it is - in fact, on Linux it *is* make install ;)
One of the great things about cmake is that it uses native build tools. :)
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

Post Reply