Skip to content

Commit

Permalink
Updating README.md, moving uninstall.sh script, adding uninstall targ…
Browse files Browse the repository at this point in the history
…et for project build process.
  • Loading branch information
akielaries committed Jan 12, 2023
1 parent e1478b1 commit 6eca160
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,14 @@ export(TARGETS ${PROJECT_NAME} FILE openMTPKConfig.cmake)
# make tests passing a requirement for the library to build
add_dependencies(${PROJECT_NAME} check)

# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/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()

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ********** WARNING **********
# THIS MAKEFILE IS NOT A PART OF THE OFFICIAL INSTALLATION PROCESS SEE BELOW :
#
# This is the Makefile used to run the modules with their respective driver
# methods as well as corresponding unit tests done with Google's gtest. This
# Makefile is only important in testing and developing within this repository
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ $ make
$ sudo make install
```
> **Note**
> This process asumes your STDLIB path is /usr/local/lib, where most 3rd-party
> libs are located if not, run the following:
> Keep the build directory for easy uninstallation. This process asumes your
> STDLIB path is /usr/local/lib, where most 3rd-party libs are located if not,
> run the following:
```
$ LD_LIBRARY_PATH=/usr/local/lib
```
Expand All @@ -106,6 +107,13 @@ $ make arith
$ make num-theory
...
```
## Uninstall
To uninstall files related to openMTPK, simply run the following:
```
# enter the build dir from installation
$ cd build
$ sudo make uninstall
```
## Python
For the Python API of openMTPK simply install with pip.
```
Expand Down
22 changes: 22 additions & 0 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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()

File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def has_ext_modules(foo):
name='openmtpk',
distclass=BinaryDistribution,
# get version from PyPI package, use bump to increment
version='0.6.0',
version=new_version,
author='Akiel Aries',
author_email='[email protected]',
description='openMTPK Python API',
Expand Down

0 comments on commit 6eca160

Please sign in to comment.