GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add cmake TARGET: uninstall · sevan/bcc@99146aa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • CMakeLists.txt
  • cmake
    • CmakeUninstall.cmake.in
  • src/python
    • CMakeLists.txt
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎CMakeLists.txt‎

Copy file name to clipboardExpand all lines: CMakeLists.txt
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,13 @@ add_subdirectory(tests)
196196
endif(ENABLE_TESTS)
197197
add_subdirectory(tools)
198198
endif(ENABLE_CLANG_JIT)
199+
200+
if(NOT TARGET uninstall)
201+
configure_file(
202+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/CmakeUninstall.cmake.in"
203+
"${CMAKE_CURRENT_BINARY_DIR}/CmakeUninstall.cmake"
204+
IMMEDIATE @ONLY)
205+
206+
add_custom_target(uninstall
207+
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CmakeUninstall.cmake)
208+
endif()
Collapse file

‎cmake/CmakeUninstall.cmake.in‎

Copy file name to clipboard
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: GPL-2.0-or-later
2+
# Copyright (C) 2022 Rong Tao
3+
#
4+
function(UninstallManifest manifest)
5+
if(NOT EXISTS "${manifest}")
6+
message(FATAL_ERROR "Cannot find install manifest: ${manifest}")
7+
endif()
8+
9+
file(READ "${manifest}" files)
10+
string(REGEX REPLACE "\n" ";" files "${files}")
11+
foreach(file ${files})
12+
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
13+
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
14+
exec_program(
15+
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
16+
OUTPUT_VARIABLE rm_out
17+
RETURN_VALUE rm_retval
18+
)
19+
if(NOT "${rm_retval}" STREQUAL 0)
20+
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
21+
endif()
22+
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
23+
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
24+
endif()
25+
endforeach()
26+
endfunction()
27+
28+
UninstallManifest("@CMAKE_BINARY_DIR@/install_manifest.txt")
29+
UninstallManifest("@CMAKE_BINARY_DIR@/install_manifest_python_bcc.txt")
Collapse file

‎src/python/CMakeLists.txt‎

Copy file name to clipboardExpand all lines: src/python/CMakeLists.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ foreach(PY_CMD ${PYTHON_CMD})
4040
install(
4141
CODE "
4242
execute_process(
43-
COMMAND ${PY_CMD} setup.py install -f ${PYTHON_FLAGS} --prefix=${CMAKE_INSTALL_PREFIX}
43+
COMMAND ${PY_CMD} setup.py install -f ${PYTHON_FLAGS} --prefix=${CMAKE_INSTALL_PREFIX} --record ${CMAKE_BINARY_DIR}/install_manifest_python_bcc.txt
4444
WORKING_DIRECTORY ${PY_DIRECTORY})"
4545
COMPONENT python)
4646
endforeach()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.