Merge pull request #413 from mattparks/patch-1

Check for existing uninstall target before creating.
This commit is contained in:
Thomas Fussell 2019-12-19 17:07:00 -05:00 committed by GitHub
commit dbc0ddd9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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