aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authoracxz <17132214+acxz@users.noreply.github.com>2020-07-30 21:16:50 -0400
committerGitHub <noreply@github.com>2020-07-30 21:16:50 -0400
commit6f6e9394ce37a737fab2a93248046dcccfa20da5 (patch)
treeeaf7c5c7b9ea0adc4f76bd636392f0883b77d567 /CMakeLists.txt
parent94db5c5ed1a0f8bde74e8b31e603c7bcccf6e3f6 (diff)
downloadplatform_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.txt9
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()