Remove folders created by install

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove folders created by install

Felix Crazzolara
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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Remove folders created by install

Kuba Ober
Use something to read the manifest, extract paths from it, remove the duplicates, then iterate them, and remove the ones that are empty. It’d be a bad idea probably to remove ones that are not empty.

Cheers, Kuba

> 16 feb. 2019 kl. 09:47 skrev Felix Crazzolara <[hidden email]>:
>
> 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
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Remove folders created by install

Eric Noulard
In reply to this post by Felix Crazzolara
There are some possible solutions and reference here:

Le sam. 16 févr. 2019 à 15:48, Felix Crazzolara <[hidden email]> a écrit :
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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


--
Eric

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake