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.
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 .
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.
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.
There should be file "install_manifest.txt" after executing "make install". The following command should work:
cat install_manifest.txt | sudo xargs rm
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With