Installed include directory layout

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
juanvp
Gnoblar
Posts: 2
Joined: Tue Apr 21, 2009 2:12 pm

Installed include directory layout

Post by juanvp » Fri Jan 10, 2014 4:21 pm

Hi, guys

When executing a make install in the 2.0 branch the generated include directory layout is wrong. Both phobossion and I, working independently, came up with different approaches to fix this. So I would like to ask those who understand better the nuances of the current approach their points of view.

The file in question is OgreMain/CMakeLists.txt. Currently it calculates a (minimal?) set of header files according to platform+threading provider to build the main lib and stores it in 3 variables. The majority of the headers are listed in the variable HEADER_FILES.
Then those same variables are used to copy the headers to the installation directory.

The problem in the current code is that the install command in cmake copies all those files to the same directory losing the original structure.
Another thing, which I don't know if it is an unintended side-effect of this methods, is that a few of the files stored in HEADER_FILES come from OgreMain/src. I expect those files to be internal and necessary only to build the main library. But because of the reuse they get deployed as well.

So one approach to fix this is on phobossion’s fork, which basically copies the whole OgreMain/include directory to the installation. This has the advantage of being simple and seems to require less maintenance as more subdirectories are added. The cons is that all files get copied, including headers for unused platforms and threading providers. It also excludes the OgreMain/src headers which I would consider a pro, but I’m not sure.

The approach I took (besides including some missing files to HEADER_FILES) is to copy each file independently making sure to retain the current subdirectory structure. This honors the calculated header set (including the /src files), but it is more complex and doesn’t improve on maintenance (adding new deployable subdirectories must still be done manually).

What are your views on these approaches? Does it matter the copying of unnecessary header files to the installation? Should the internal headers be excluded from the deploy?
0 x

Post Reply