Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matplotlibcpp17
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HKHLR
matplotlibcpp17
Commits
3eeee5c8
Commit
3eeee5c8
authored
3 years ago
by
soblin
Browse files
Options
Downloads
Patches
Plain Diff
added uninstall target
parent
f6cc9755
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+14
-0
14 additions, 0 deletions
CMakeLists.txt
cmake/uninstall.cmake.in
+21
-0
21 additions, 0 deletions
cmake/uninstall.cmake.in
with
35 additions
and
0 deletions
CMakeLists.txt
+
14
−
0
View file @
3eeee5c8
...
...
@@ -92,3 +92,17 @@ install(FILES
install
(
DIRECTORY
${
PROJECT_SOURCE_DIR
}
/include/
${
PROJECT_NAME
}
DESTINATION include
)
# uninstall target
## actually it's just `xargs rm < install_manifest.txt`
## https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
if
(
NOT TARGET uninstall
)
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/uninstall.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target
(
uninstall
COMMAND
${
CMAKE_COMMAND
}
-P
${
CMAKE_CURRENT_BINARY_DIR
}
/uninstall.cmake
)
endif
()
This diff is collapsed.
Click to expand it.
cmake/uninstall.cmake.in
0 → 100644
+
21
−
0
View file @
3eeee5c8
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif()
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif()
endforeach()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment