Skip to content

Commit

Permalink
build(cmake): support uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
Codesire-Deng committed Jun 23, 2023
1 parent 3ca06b3 commit 5fc5b08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,15 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/co_context-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/co_context-config-version.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/co_context
)
)

# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${co_context_SOURCE_DIR}/cmake/templates/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()
2 changes: 1 addition & 1 deletion cmake/templates/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ unset(kernel_version)

include("${CMAKE_CURRENT_LIST_DIR}/co_context_targets.cmake")

check_required_components(co_context)
check_required_components(co_context)

0 comments on commit 5fc5b08

Please sign in to comment.