From f0e79bafd8823aedf535e9b344d4cf9a4f9747e5 Mon Sep 17 00:00:00 2001 From: Dimo Markov Date: Wed, 8 Jan 2020 20:37:16 +0200 Subject: [PATCH] Added uninstall target check to cmakelists --- CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1efda0e9..ece2fa44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1544,15 +1544,16 @@ if (EVENT__DOXYGEN) endif() -# Create the uninstall target. -# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake -configure_file(${PROJECT_SOURCE_DIR}/cmake/Uninstall.cmake.in - ${PROJECT_BINARY_DIR}/Uninstall.cmake - @ONLY) - -add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/Uninstall.cmake) +if (NOT TARGET uninstall) + # Create the uninstall target. + # https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake + configure_file(${PROJECT_SOURCE_DIR}/cmake/Uninstall.cmake.in + ${PROJECT_BINARY_DIR}/Uninstall.cmake + @ONLY) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/Uninstall.cmake) +endif() message(STATUS "") message(STATUS " ---( Libevent " ${EVENT_VERSION} " )---") -- 2.50.1