make uninstall

22 views
Skip to first unread message

joseph....@gmail.com

unread,
Oct 14, 2012, 5:14:00 AM10/14/12
to ldc...@googlegroups.com
Hello all,

So far as I can see the Makefile generated by cmake does not include an 'uninstall' option. So what's a boy to do if he wants to (temporarily, of course) clear out a from-source install of LDC?

In my case I put everything in /usr/local rather than a custom location like /opt/ldc, so it's not like I can just rm -rf.

Can anyone advise?

Thanks & best wishes,

-- Joe

Kai

unread,
Oct 14, 2012, 7:05:56 AM10/14/12
to ldc...@googlegroups.com
Hi Joe!

I work in the same way. Therefore I can't provide a better solution.

An uninstall target could be added to CMakeLists.txt as described in the
FAQ:
http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
But I have not tried it...

Regards
Kai

joseph....@gmail.com

unread,
Oct 16, 2012, 6:12:56 AM10/16/12
to ldc...@googlegroups.com, k...@redstar.de
On Sunday, 14 October 2012 13:10:05 UTC+2, Kai wrote:
> An uninstall target could be added to CMakeLists.txt as described in the
>
> FAQ:
>
> http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F

Thanks! Actually the given alternative in that FAQ,

xargs rm < install_manifest.txt

seems like a perfectly workable option. At any rate works for me (so far...:-)

For devs -- any reason not to add the uninstall option to ldc's cmake setup? I'm happy to test it and submit a pull request but only if it's in principle acceptable to you. :-)

David Nadlinger

unread,
Oct 17, 2012, 12:52:54 PM10/17/12
to ldc...@googlegroups.com
On 16 Oct 2012, at 12:12, joseph....@gmail.com wrote:
> For devs -- any reason not to add the uninstall option to ldc's cmake
> setup? I'm happy to test it and submit a pull request but only if
> it's in principle acceptable to you. :-)

I am not sure what to do about this. »make uninstall« seems like a
valid improvement, and I can see how it would be useful in some
situations, but on the other hand, I have never used it myself on Linux
or OS X with any open source projects, CMake doesn't support it by
default, and providing an innocent-looking command which goes on to
delete files on the users system comes with a big, BIG burden to get it
right.

What I'm trying to say is that I think providing an uninstallation
facility comes with bigger support obligations than it might seem at
first, and there is already a tool dedicated to exactly this sort of
thing – your distro's package manager.

Maybe we could just link the CMake FAQ in our docs, with the
recommendation to rely on the system package manager instead whenever
possible?

David

joseph....@gmail.com

unread,
Oct 22, 2012, 11:05:44 AM10/22/12
to ldc...@googlegroups.com
On Wednesday, 17 October 2012 18:53:42 UTC+2, David Nadlinger wrote:
> I am not sure what to do about this. »make uninstall« seems like a
> valid improvement, and I can see how it would be useful in some
> situations, but on the other hand, I have never used it myself on Linux
> or OS X with any open source projects, CMake doesn't support it by
> default, and providing an innocent-looking command which goes on to
> delete files on the users system comes with a big, BIG burden to get it
> right.

Fair enough. My personal take on it is that CMake surely knows what files it's installing and where it's putting them, and so a command to remove them surely isn't too much to ask -- but I can see the risk. I've used it with from-source installs fairly often with autotools-based stuff, so it was a surprise to discover that CMake doesn't by default offer an uninstall target.

> What I'm trying to say is that I think providing an uninstallation
> facility comes with bigger support obligations than it might seem at
> first, and there is already a tool dedicated to exactly this sort of
> thing – your distro's package manager.

Well, we're talking about from-source installs only -- it's an option that surely only matters to devs or people who are comfortable on the edge. But I see very much your point that it's a complication that might be worth avoiding.

Out of curiosity, how do _you_ remove files that were installed from source, if a "make uninstall" option isn't available? Or does it not really come up for you?

> Maybe we could just link the CMake FAQ in our docs, with the
> recommendation to rely on the system package manager instead whenever
> possible?

Sure, sounds like a good compromise. Though I'm not sure I see the relevance of the package manager as if you install a package (rather than from source) you'll also uninstall that way -- but AFAICS the package manager doesn't take account of from-source installs. Or am I about to be educated about an aspect of GNU/Linux that has previously passed me by? :-)

Best wishes,

-- Joe
Reply all
Reply to author
Forward
0 new messages