Automatic dependencies management with ExternalProject
- Mikachu
- Gnoll
- Posts: 603
- Joined: Thu Jul 28, 2005 4:11 pm
- Location: Nice, France
- x 35
Automatic dependencies management with ExternalProject
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...
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...
OgreProcedural - Procedural Geometry for Ogre3D
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
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.
-
- Minaton
- Posts: 933
- Joined: Mon Mar 05, 2012 11:37 am
- Location: Germany
- x 110
Re: Automatic dependencies management with ExternalProject
This is an interesting option. But it's not usable for Ogre now, because the dependencies are using different build systems and not CMake.
- Wolfmanfx
- OGRE Team Member
- Posts: 1525
- Joined: Fri Feb 03, 2006 10:37 pm
- Location: Austria - Leoben
- x 99
- Contact:
- Mikachu
- Gnoll
- Posts: 603
- Joined: Thu Jul 28, 2005 4:11 pm
- Location: Nice, France
- x 35
Re: Automatic dependencies management with ExternalProject
If I understand correctly, it could work with non-cmaked dependencies.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.
For example, I read about a 'addBoost.cmake' macro, which downloads the latest boost version and compiles it (never tried it, though)
OgreProcedural - Procedural Geometry for Ogre3D
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
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?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.
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: Automatic dependencies management with ExternalProject
So this is like a primitive package manager? Maybe interesting on windows. On anything else, native package managers + pkgconfig should be far superior
-
- Minaton
- Posts: 933
- Joined: Mon Mar 05, 2012 11:37 am
- Location: Germany
- x 110
Re: Automatic dependencies management with ExternalProject
I know that, but I don't want to use it, because they are not up to date.Klaim wrote: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?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.
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
But that's your problem then 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).
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).
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 138
Re: Automatic dependencies management with ExternalProject
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.
-
- Minaton
- Posts: 933
- Joined: Mon Mar 05, 2012 11:37 am
- Location: Germany
- x 110
Re: Automatic dependencies management with ExternalProject
I test it 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.Klaim wrote:But that's your problem then 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.
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
Would you consider to provide PRs to the Ogre dependencies repo so that we all benefit from your upgraded dependencies?
-
- Minaton
- Posts: 933
- Joined: Mon Mar 05, 2012 11:37 am
- Location: Germany
- x 110
Re: Automatic dependencies management with ExternalProject
I could do that, but I only test them on windows! I have no idea what happens on Linux etc.Klaim wrote:Would you consider to provide PRs to the Ogre dependencies repo so that we all benefit from your upgraded dependencies?
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: Automatic dependencies management with ExternalProject
Don't worry, no one uses that on linux. We have package managers
-
- Minaton
- Posts: 933
- Joined: Mon Mar 05, 2012 11:37 am
- Location: Germany
- x 110
Re: Automatic dependencies management with ExternalProject
I can build the dependencies for windows package manager, too.scrawl wrote:Don't worry, no one uses that on linux. We have package managers
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.
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
I will have to because I need the dependencies to be the same, with the same modifications, for my project.scrawl wrote:Don't worry, no one uses that on linux. We have package managers
-
- OGRE Expert User
- Posts: 1119
- Joined: Sat Jan 01, 2011 7:57 pm
- x 216
Re: Automatic dependencies management with ExternalProject
What kind of modifications do you need?
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
Re: Automatic dependencies management with ExternalProject
For example, until OIS is removed from dependencies: https://bitbucket.org/cabalistic/ogrede ... is-as/diffscrawl wrote:What kind of modifications do you need?
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.