File tree 3 files changed +41
-0
lines changed
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -74,5 +74,17 @@ install(
74
74
DESTINATION lib/cmake/huron/Modules
75
75
)
76
76
77
+ # Uninstall target
78
+ # Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
79
+ if (NOT TARGET uninstall)
80
+ configure_file (
81
+ "${CMAKE_CURRENT_SOURCE_DIR} /cmake_uninstall.cmake.in"
82
+ "${CMAKE_CURRENT_BINARY_DIR} /cmake_uninstall.cmake"
83
+ IMMEDIATE @ONLY)
84
+
85
+ add_custom_target (uninstall
86
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR} /cmake_uninstall.cmake)
87
+ endif ()
88
+
77
89
# Build examples
78
90
add_subdirectory (examples)
Original file line number Diff line number Diff line change @@ -43,3 +43,10 @@ Notes:
43
43
- Currently, the project can be built on Linux only
44
44
- By default, the project builds for Raspberry Pi (armv7l). To change platform,
45
45
` BUILD_TYPE ` needs to be changed. For example, on Linux x86_64: ` -DBUILD_TYPE=x86_64 `
46
+
47
+ Uninstall:
48
+
49
+ ```
50
+ cd build
51
+ sudo make uninstall
52
+ ```
Original file line number Diff line number Diff line change
1
+ # Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
2
+ if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt" )
3
+ message (FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt" )
4
+ endif ()
5
+
6
+ file (READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files )
7
+ string (REGEX REPLACE "\n " ";" files "${files} " )
8
+ foreach (file ${files} )
9
+ message (STATUS "Uninstalling $ENV{DESTDIR}${file} " )
10
+ if (IS_SYMLINK "$ENV{DESTDIR}${file} " OR EXISTS "$ENV{DESTDIR}${file} " )
11
+ exec_program (
12
+ "@CMAKE_COMMAND@" ARGS "-E remove \" $ENV{DESTDIR}${file} \" "
13
+ OUTPUT_VARIABLE rm_out
14
+ RETURN_VALUE rm_retval
15
+ )
16
+ if (NOT "${rm_retval} " STREQUAL 0)
17
+ message (FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file} " )
18
+ endif ()
19
+ else (IS_SYMLINK "$ENV{DESTDIR}${file} " OR EXISTS "$ENV{DESTDIR}${file} " )
20
+ message (STATUS "File $ENV{DESTDIR}${file} does not exist." )
21
+ endif ()
22
+ endforeach ()
You can’t perform that action at this time.
0 commit comments