Skip to content

Commit

Permalink
[uninstall] Fix --config when there is multi-config generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-stasse committed Sep 4, 2023
1 parent 47b924b commit c51e294
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion uninstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
)

0 comments on commit c51e294

Please sign in to comment.