diff --git a/CMakeLists.txt b/CMakeLists.txt index ee51d6d..6dba433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,7 +51,10 @@ endforeach() # Configure install destination install(TARGETS cropsimpletools ${EXELIST} - RUNTIME DESTINATION ${SMPT_SOURCE_DIR}/bin - LIBRARY DESTINATION ${SMPT_SOURCE_DIR}/lib - ARCHIVE DESTINATION ${SMPT_SOURCE_DIR}/lib/static) + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib + ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/static) + +# Provide easy (but dumb) way to uninstall +add_custom_target(uninstall xargs rm -v < install_manifest.txt) diff --git a/README.md b/README.md index a022cc7..62c5167 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,28 @@ The most recent version of simpletools, including the above documentation will a Bug reports, feature requests, comments and patches are always welcome. \ conor.fitzpatrick@cern.ch + +## Installation + +Building and installing are done with CMake. +If you want to install simpletools system-wide, run: + + cmake . + make + sudo make install + +If you don't have administrator privileges and/or want to install locally, use `-DCMAKE_INSTALL_PREFIX` to change the destination, *e.g.*: + + cmake . -DCMAKE_INSTALL_PREFIX=~/.local/ + make + make install + +### Uninstallation + +After running `make install`, a file called `install_manifest.txt` will be created, which lists the destinations of all installed binaries and libraries. +To uninstall, you can run: + + make uninstall + +which will delete every file listed in `install_manifest.txt`. +