Skip to content

Commit

Permalink
Check for existing uninstall target before creating.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattparks authored Sep 20, 2019
1 parent f302601 commit 9eee8ec
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# Add uninstall target
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
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)
endif()

if(NOT MSVC)
# Set pkg-config variables
Expand Down

0 comments on commit 9eee8ec

Please sign in to comment.