From 8c727e5ce13b288d982471120b19c037a1cb9624 Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Sun, 25 Jul 2021 15:11:11 +0000 Subject: [PATCH] Only define an "uninstall" target if it's not already defined (e.g. by projects that include json-c) --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01d37f8b..ed7bc03b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -436,10 +436,12 @@ include_directories(${PROJECT_BINARY_DIR}) add_subdirectory(doc) # uninstall -add_custom_target(uninstall - COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) +if(NOT TARGET uninstall) + add_custom_target(uninstall + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() # XXX for a normal full distribution we'll need to figure out # XXX how to build both shared and static libraries. -- 2.47.2