Check for existing uninstall target before creating.

This commit is contained in:
Matthew Albrecht 2019-09-20 15:13:09 -05:00 committed by GitHub
parent f30260153f
commit 9eee8ec0bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,15 +250,17 @@ install(DIRECTORY ${XLNT_INCLUDE_DIR}/xlnt
install(FILES ${XLNT_ROOT_DIR}/docs/xlnt.3
DESTINATION ${MAN_DEST_DIR}/man3)
# Configure uninstall
configure_file("${XLNT_ROOT_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
if(NOT TARGET uninstall)
# Configure uninstall
configure_file("${XLNT_ROOT_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
# Add uninstall target
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
# Add uninstall target
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
if(NOT MSVC)
# Set pkg-config variables