diff options
author | acxz <17132214+acxz@users.noreply.github.com> | 2020-07-30 21:16:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 21:16:50 -0400 |
commit | 6f6e9394ce37a737fab2a93248046dcccfa20da5 (patch) | |
tree | eaf7c5c7b9ea0adc4f76bd636392f0883b77d567 /CMakeLists.txt | |
parent | 94db5c5ed1a0f8bde74e8b31e603c7bcccf6e3f6 (diff) | |
download | platform_external_python_pybind11-6f6e9394ce37a737fab2a93248046dcccfa20da5.tar.gz platform_external_python_pybind11-6f6e9394ce37a737fab2a93248046dcccfa20da5.tar.bz2 platform_external_python_pybind11-6f6e9394ce37a737fab2a93248046dcccfa20da5.zip |
feat: add uninstall target for CMake (#2265)
* add uninstall target for cmake
* only add target when built as master project
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 31e253f..a9ab4fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,3 +246,12 @@ if(PYBIND11_INSTALL) NAMESPACE "pybind11::" DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR}) endif() + +# Uninstall target +if(PYBIND11_MASTER_PROJECT) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) + + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() |