Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
coal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coal
coal
Commits
f9ba8045
Commit
f9ba8045
authored
10 years ago
by
Jeongseok Lee
Browse files
Options
Downloads
Patches
Plain Diff
Add cmake uninstall target
parent
49a6edfa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+7
-0
7 additions, 0 deletions
CMakeLists.txt
CMakeModules/cmake_uninstall.cmake.in
+21
-0
21 additions, 0 deletions
CMakeModules/cmake_uninstall.cmake.in
with
28 additions
and
0 deletions
CMakeLists.txt
+
7
−
0
View file @
f9ba8045
...
@@ -130,6 +130,13 @@ install(DIRECTORY include/ DESTINATION include
...
@@ -130,6 +130,13 @@ install(DIRECTORY include/ DESTINATION include
install
(
FILES
"
${
pkg_conf_file
}
"
DESTINATION lib/pkgconfig/ COMPONENT pkgconfig
)
install
(
FILES
"
${
pkg_conf_file
}
"
DESTINATION lib/pkgconfig/ COMPONENT pkgconfig
)
# Add uninstall target
configure_file
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/CMakeModules/cmake_uninstall.cmake.in"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/CMakeModules/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target
(
uninstall
"
${
CMAKE_COMMAND
}
"
-P
"
${
CMAKE_CURRENT_BINARY_DIR
}
/CMakeModules/cmake_uninstall.cmake"
)
enable_testing
()
enable_testing
()
add_subdirectory
(
test
)
add_subdirectory
(
test
)
This diff is collapsed.
Click to expand it.
CMakeModules/cmake_uninstall.cmake.in
0 → 100644
+
21
−
0
View file @
f9ba8045
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_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(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
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