Page 1 of 1

Automatic dependencies management with ExternalProject

Posted: Thu Nov 14, 2013 4:33 pm
by Mikachu
Hi,

From it's 2.8 version, CMake supports the ExternalProject_Add command, which enables a project to automatically download/update/build its dependencies, without any manual intervention.
I think it could make building Ogre even easier and more straightforward... (of course, it should be possible to disable it, in case dependencies are already available on the PC).

I always considered C++'s dependency management rather tedious, I guess this feature could improve it (not as systematic as maven in the java world, of course, but still an improvement)

More documentation can be found here

Of course, if I find some time, I'll try to do this myself, starting with my own library...

Re: Automatic dependencies management with ExternalProject

Posted: Thu Nov 14, 2013 11:30 pm
by Klaim
If the CMake version used by boost is upgraded, I suggest also adding include and definition informations so that using the Ogre targets implicitely generate include directory and compilation definition for the user. See target_include_directories and target_compile_definitions commands in the recent documentation.

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 10:35 am
by Transporter
This is an interesting option. But it's not usable for Ogre now, because the dependencies are using different build systems and not CMake.

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 10:36 am
by Wolfmanfx
Deps using CMake

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 11:01 am
by Mikachu
Transporter wrote:This is an interesting option. But it's not usable for Ogre now, because the dependencies are using different build systems and not CMake.
If I understand correctly, it could work with non-cmaked dependencies.

For example, I read about a 'addBoost.cmake' macro, which downloads the latest boost version and compiles it (never tried it, though)

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 2:51 pm
by Klaim
Transporter wrote:This is an interesting option. But it's not usable for Ogre now, because the dependencies are using different build systems and not CMake.
I build the dependencies using CMake. Maybe you don't know that there is a repository with all the dependencies gathered together and projects defined through CMake?

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 2:57 pm
by scrawl
So this is like a primitive package manager? Maybe interesting on windows. On anything else, native package managers + pkgconfig should be far superior :)

Re: Automatic dependencies management with ExternalProject

Posted: Fri Nov 15, 2013 11:08 pm
by Transporter
Klaim wrote:
Transporter wrote:This is an interesting option. But it's not usable for Ogre now, because the dependencies are using different build systems and not CMake.
I build the dependencies using CMake. Maybe you don't know that there is a repository with all the dependencies gathered together and projects defined through CMake?
I know that, but I don't want to use it, because they are not up to date.

Re: Automatic dependencies management with ExternalProject

Posted: Sat Nov 16, 2013 12:03 am
by Klaim
But that's your problem then :D I understand that some want to update the dependencies of their dependencies but personally I don't have time to do it. Also, Ogre is not tested against other versions of these dependencies, so I don't want to upgrade them. Finally, personally, except OIS, I don't use directly these Ogre dependencies, so for most of us I guess it's ok.

By the way, cmake have ways to bind non-cmake projects to cmake targets, so you can use (some of) the functions to associate compiler definitions and include directories.
That's what I do with TBB (which don't provide CMake files yet - I wanted to provide them some but didn't find the time in the end).

Re: Automatic dependencies management with ExternalProject

Posted: Sat Nov 16, 2013 12:13 am
by c6burns
I feel like the Ogre team does enough to ensure ease of use that I don't need them to bother figuring out how to build boost for me on every possible environment. Also for any users who actually struggle building dependencies they bundle everything together regularly into SDK downloads. Plus the dependencies are regularly built as a seperate download, so I think everything is top notch in the convenience department.

Re: Automatic dependencies management with ExternalProject

Posted: Sat Nov 16, 2013 9:46 am
by Transporter
Klaim wrote:But that's your problem then :D I understand that some want to update the dependencies of their dependencies but personally I don't have time to do it. Also, Ogre is not tested against other versions of these dependencies, so I don't want to upgrade them.
I test it :D I have the time because I have a couple of batch scripts which are building all dependencies. I only have to do some work if there are bugs in the dependencies or the project files have been modified.

Re: Automatic dependencies management with ExternalProject

Posted: Sat Nov 16, 2013 11:57 am
by Klaim
Would you consider to provide PRs to the Ogre dependencies repo so that we all benefit from your upgraded dependencies?

Re: Automatic dependencies management with ExternalProject

Posted: Sun Nov 17, 2013 9:00 am
by Transporter
Klaim wrote:Would you consider to provide PRs to the Ogre dependencies repo so that we all benefit from your upgraded dependencies?
I could do that, but I only test them on windows! I have no idea what happens on Linux etc.

Re: Automatic dependencies management with ExternalProject

Posted: Sun Nov 17, 2013 12:46 pm
by scrawl
Don't worry, no one uses that on linux. We have package managers :wink:

Re: Automatic dependencies management with ExternalProject

Posted: Sun Nov 17, 2013 1:35 pm
by Transporter
scrawl wrote:Don't worry, no one uses that on linux. We have package managers :wink:
I can build the dependencies for windows package manager, too. :wink:
https://drive.google.com/folderview?id= ... sp=sharing
But I don't know if there are any package manager for Win8 RT, OSX, Android and iOS.

Re: Automatic dependencies management with ExternalProject

Posted: Sun Nov 17, 2013 1:42 pm
by Klaim
scrawl wrote:Don't worry, no one uses that on linux. We have package managers :wink:
I will have to because I need the dependencies to be the same, with the same modifications, for my project.

Re: Automatic dependencies management with ExternalProject

Posted: Sun Nov 17, 2013 2:27 pm
by scrawl
What kind of modifications do you need?

Re: Automatic dependencies management with ExternalProject

Posted: Mon Nov 18, 2013 12:53 am
by Klaim
scrawl wrote:What kind of modifications do you need?
For example, until OIS is removed from dependencies: https://bitbucket.org/cabalistic/ogrede ... is-as/diff

Also when I upgrade Ogre or any other dependency of my project, I get the code source of the version I want, put it in my repo and check if everything works. If at some point something don't work and it's in Ogre, I try to fix it and make a pull requests. But sometime the fix is a quickfix which shouldn't appear in Ogre main base so I do the quickfix for me and talk about the problem on this forum. Ogre people are very reactive so a solution is often found and implemented quickly, but I can't say the same for all libraries I use (and I use a lot).
Same thing with Boost.

What I mean is that my code is supposed to compile with a specific version of my dependencies, and these (maybe modified versions of) dependencies needs to be shiped in the final product, so no package manager will help with that.