fix: uninstall cleanup (#2346)

This commit is contained in:
Henry Schreiner 2020-07-31 04:16:40 -04:00 committed by GitHub
parent 6f6e9394ce
commit b8047245bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@ CMakeCache.txt
CMakeFiles CMakeFiles
Makefile Makefile
cmake_install.cmake cmake_install.cmake
cmake_uninstall.cmake
.DS_Store .DS_Store
*.so *.so
*.pyd *.pyd

View File

@ -245,13 +245,13 @@ if(PYBIND11_INSTALL)
EXPORT "${PYBIND11_EXPORT_NAME}" EXPORT "${PYBIND11_EXPORT_NAME}"
NAMESPACE "pybind11::" NAMESPACE "pybind11::"
DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR}) DESTINATION ${PYBIND11_CMAKECONFIG_INSTALL_DIR})
endif()
# Uninstall target # Uninstall target
if(PYBIND11_MASTER_PROJECT) if(PYBIND11_MASTER_PROJECT)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
endif() endif()