From: Eric Haszlakiewicz Date: Sun, 25 Jul 2021 15:11:11 +0000 (+0000) Subject: Only define an "uninstall" target if it's not already defined (e.g. by projects that... X-Git-Tag: json-c-0.16-20220414~37^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c727e5ce13b288d982471120b19c037a1cb9624;p=thirdparty%2Fjson-c.git Only define an "uninstall" target if it's not already defined (e.g. by projects that include json-c) --- 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.