diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aa79d6..4d0d9f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,8 +67,12 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -add_custom_target(uninstall "${CMAKE_COMMAND}" - -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +# When opening super project, prevent redefinition of uninstall target. +if (NOT TARGET uninstall) + add_custom_target(uninstall "${CMAKE_COMMAND}" + -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +endif() + # Does not work with ninja on Win32. if (NOT (WIN32 AND CMAKE_GENERATOR STREQUAL "Ninja")) |