Installing data files

John Layt john at layt.net
Thu May 27 22:19:44 CEST 2010


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?

Cheers!

John.


More information about the Kde-buildsystem mailing list