[CMake] CPack Mac OSX bundle uninstall

Michael Wild themiwi at gmail.com
Wed May 5 10:33:53 EDT 2010


On 5. May, 2010, at 16:22 , Werner Smekal wrote:

> Hi,
> 
> On 5/5/10 4:00 PM, David Ojeda wrote:
>> Hello cmakers!
>> 
>> I am developing a C++ library and I am testing CMake with Cpack with the
>> bundle generator for mac osx (BTW, great work! Very easy to use!). I
>> have successfully generated a .dmg that has a .pkg. I managed to install
>> the libraries and headers that are included with my library. However, I
>> wanted to uninstall it and I can't find a suitable way to do this.
>> 
>> Normally, I will distribute this (compiled) library and headers as a
>> .dmg or .deb (for debian). The onyl way I found to uninstall under Mac,
>> was adding an uninstall target to the CMakeLists.txt. Unfortunately, not
>> all developers will have cmake so this option is not very attractive.
>> 
>> How do you uninstall your files installed with the .dmg/.pkg generated
>> by the mac osx bundle generator of CPack?
> AFAIK, there is no standard way to uninstall programm/libraries
> installed with the apple installer. E.g. Qt is distributed as pkg and
> also installs a python script, which if run uninstalls all libraries and
> headers again. This is what I regularly see (actually rarely, since most
> of the time there is no uninstaller at all). I don't know of any other
> reliable option.
> 
> Further see here:
> http://www.macosxhints.com/article.php?story=20071214144159216
> http://www.macosxhints.com/article.php?story=20100107090139622
> 
> If you read through the comments you'll see other solutions and many
> warnings, so best IMO is to provide an uninstall script, which may be
> automatically configured during the cmake stage.
> 
> Regards,
> Werner

It really is useful to look at the uninstaller used by Qt (/Developer/Tools/uninstall-qt.py). Especially there is the fact that apparently under Snow Leopard the receipts are only under /var/db/receipts and no longer get copied to /Library/Receipts.


HTH

Michael



More information about the CMake mailing list