Installing data files

Albert Astals Cid aacid at kde.org
Sat May 29 11:03:32 CEST 2010


A Dijous, 27 de maig de 2010, Allen Winter va escriure:
> On Thursday 27 May 2010 4:19:44 pm John Layt wrote:
> > Hi,
> > 
> > I keep forgetting to add new/changed data files to install to the
> > CMakeLists.txt for a number of data file sets I maintain (holidays,
> > currencies, locales), so I was thinking of replacing the current explicit
> > and long lists of data files to install with something like:
> > 
> > file(GLOB _newfiles plan1/holiday_*)
> > install(FILES ${_newfiles}
> > 
> >         DESTINATION ${DATA_INSTALL_DIR}/libkholidays/plan1)
> > 
> > Is this an acceptable approach to take?  Any gotcha's to look out for?
> > 
> > The other problem I have is that the names of the data files may change
> > over time and releases, or may even be deleted, so just installing
> > changed files may result in obsolete data files being left installed.  I
> > was wondering how this is usually dealt with?  Is there an uninstall
> > function?
> > 
> > I was thinking I could delete the already installed files each time
> > before the new set is installed, which seems slightly dodgy to me:
> > 
> > file(GLOB _oldfiles ${DATA_INSTALL_DIR}/libkholidays/plan1/holiday_*)
> > if(_oldfiles)
> > 
> >     file(REMOVE ${_oldfiles})
> > 
> > endif(_oldfiles)
> > 
> > Again, is this an acceptable thing to do, or is there a better way?
> > 
> > Also, how does this affect packagers, do I need to tell them?
> 
> I don't think GLOBing does anything to create proper dependencies.
> So you need to be a bit careful using it.
> 
> For just installing data files, I think it seems pretty safe though.

Though unless you touch the cmake files so that cmake is rerun the new files 
won't get installed as the globing is done on cmake time not on install time 
so new files after cmake run are not detected (at least that is what happened 
some time ago, no idea if was fixed)

Albert

> 
> _______________________________________________
> Kde-buildsystem mailing list
> Kde-buildsystem at kde.org
> https://mail.kde.org/mailman/listinfo/kde-buildsystem


More information about the Kde-buildsystem mailing list