]> granicus.if.org Git - libevent/commitdiff
Added uninstall target check to cmakelists
authorDimo Markov <dimo.markov@egt-bg.com>
Wed, 8 Jan 2020 18:37:16 +0000 (20:37 +0200)
committerDimo Markov <dimo.markov@egt-bg.com>
Wed, 8 Jan 2020 18:37:16 +0000 (20:37 +0200)
CMakeLists.txt

index 1efda0e9867ebf7560e90ba9ad223ee4477d845d..ece2fa44df4103c6a0678d19267115d8824b5e9c 100644 (file)
@@ -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} " )---")