From 3c4db5dcb08f6bf607d05cf5901958284ab7b632 Mon Sep 17 00:00:00 2001 From: Olivier Stasse Date: Mon, 4 Sep 2023 17:16:33 +0200 Subject: [PATCH] [uninstall] Fix --config when there is no multi-config generator. --- uninstall.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uninstall.cmake b/uninstall.cmake index 4b06de92d..f1fad275f 100644 --- a/uninstall.cmake +++ b/uninstall.cmake @@ -51,6 +51,10 @@ endmacro(_SETUP_PROJECT_UNINSTALL) # We setup the auto-uninstall target here, it is early enough that we can ensure # it is going to be called first See the first paragraph here # https://cmake.org/cmake/help/latest/command/install.html#introduction +if(DEFINED CMAKE_CONFIGURATION_TYPES) + set(UNINSTALL_CONFIG_ARG "--config \${CMAKE_INSTALL_CONFIG_NAME}") +endif() install( - CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${PROJECT_BINARY_DIR}\" --config \${CMAKE_INSTALL_CONFIG_NAME} --target uninstall)" + CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${PROJECT_BINARY_DIR}\" ${UNINSTALL_CONFIG_ARG} --target uninstall)" ) +