[CMake] Remove folders created by install

Felix Crazzolara felix.crazzolara at gmail.com
Sat Feb 16 09:47:45 EST 2019


Hi everyone

For my smaller projects I'd like to have 'uninstall' functionality. To 
remove installed files I can call:

xargs rm < build/install_manifest.txt

Unfortunately this won't delete any folders generated by the 
installation. Is there a different file that keeps track of the created 
directories, or what is the recommended way to implement such functionality?

Example:
Suppose that I install <project-name>_some_header.hpp in 
<prefix>/include/<project-name>/ using the command install(TARGETS 
<project-name> EXPORT <project-name>-targets ARCHIVE DESTINATION lib 
PUBLIC_HEADER DESTINATION include/<project-name>) then I want not only 
to remove 
<prefix>/include/<project-name>/<project-name>_some_header.hpp, but also 
the directory <prefix>/include/<project-name>/.

Cheers,

Felix Crazzolara



More information about the CMake mailing list