diff options
author | Karl Schultz <[email protected]> | 2018-06-12 15:06:34 -0600 |
---|---|---|
committer | Karl Schultz <[email protected]> | 2018-06-12 15:06:34 -0600 |
commit | 70413b6dcb020aeb5bb38ff32eabc94c16d51f9b (patch) | |
tree | 14d590966a77283eb21676c1778a501387d3e757 | |
parent | 634e3658d6fa8f95f9062a3a7831d5567baf0eb3 (diff) | |
download | Vulkan-Headers-70413b6dcb020aeb5bb38ff32eabc94c16d51f9b.tar.gz Vulkan-Headers-70413b6dcb020aeb5bb38ff32eabc94c16d51f9b.zip |
cmake: Prevent redefinition of uninstall target
Allows for this repo to be included as a submodule of another
repo that defines its own uninstall target. The uninstall target
is best defined at the top-level repo.
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cd8911..55e78dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,11 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTA install(DIRECTORY "${CMAKE_SOURCE_DIR}/registry" DESTINATION ${CMAKE_INSTALL_DATADIR}/vulkan) # uninstall target -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) -add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif()
\ No newline at end of file |