Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cleaning CMake installed files

Tags:

cmake

I have some executables/libraries being placed into the system paths using CMake's "install" keyword. Is there a built-in mechanism to do something like a "distclean", where all installed files are removed?

Endless Google searches have repeatedly turned-up conversations where the responses always mention "rm -fr " if the question mentions "cmake" and "cleanup", without reading it more closely.

like image 828
Dustin Oprea Avatar asked Nov 12 '13 04:11

Dustin Oprea


People also ask

How do I uninstall CMake packages?

Since you installed cmake by compiling it and then running sudo make install , the solution is for you to: Use cd to go back to the directory where you ran that command. Run sudo make uninstall .

Can I delete CMake cache?

Deleting CMakeCache. txt should not affect any binaries, a full rebuild is not triggered. Otherwise you might have a local variable passed on before being cached which then leads to inconsistent runs. The regeneration of the project can trigger rebuilds if the configuration is different to the previous one.

Where does CMake install files?

Install directory used by install. If “make install” is invoked or INSTALL is built, this directory is prepended onto all install directories. This variable defaults to /usr/local on UNIX and c:/Program Files on Windows.


2 Answers

There should be file "install_manifest.txt" after executing "make install". The following command should work:

cat install_manifest.txt | sudo xargs rm
like image 149
Ferry Avatar answered Sep 24 '22 19:09

Ferry


You could ask the authors of the software to add an 'uninstall' target in CMake, see https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake

so that you can just call make uninstall.

like image 39
ferdymercury Avatar answered Sep 24 '22 19:09

ferdymercury