From 7268fc18b4b63f8f65fe294dfeaef0b931514233 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 27 Jul 2011 15:46:19 +0200 Subject: [PATCH] Don't clobber higher-level uninstall targets. --- CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0c2eeef..06acbef0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,11 +155,14 @@ install(FILES COPYING.txt readme.html #-------------------------------------------------------------------- # Uninstall operation +# Don't generate this target if a higher-level project already has #-------------------------------------------------------------------- -configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in - ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) +if(NOT TARGET uninstall) + configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) -add_custom_target(uninstall - ${CMAKE_COMMAND} -P - ${GLFW_BINARY_DIR}/cmake_uninstall.cmake) + add_custom_target(uninstall + ${CMAKE_COMMAND} -P + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake) +endif()