From 4f8ab56ae77c88af9c12fe38ac2faace918eafdb Mon Sep 17 00:00:00 2001 From: fherrero <fherrero@iri.upc.edu> Date: Thu, 28 May 2020 11:06:07 +0200 Subject: [PATCH] Readme template: update command line format --- ReadMe_template.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/ReadMe_template.md b/ReadMe_template.md index 72e5872..4b75c60 100755 --- a/ReadMe_template.md +++ b/ReadMe_template.md @@ -7,13 +7,10 @@ project_description ## Installation -* Add the labrobotica repository if it is not already added: - -Run the commands on _add repository_ and _add key_ from [labrobotica_how_to installation](https://gitlab.iri.upc.edu/labrobotica/labrobotica_how_to/-/blob/master/README.md#installation) - +* Add the labrobotica repository if it is not already added: run the commands on _add repository_ and _add key_ from [labrobotica_how_to installation](https://gitlab.iri.upc.edu/labrobotica/labrobotica_how_to/-/blob/master/README.md#installation) * Install the package: -``` sudo apt update && sudo apt install iri-project-name-dev ``` + sudo apt update && sudo apt install iri-project-name-dev ## Disclaimer @@ -50,20 +47,20 @@ This package also requires of the following dependencies: Clone this repository and create a build folder inside: -``` mkdir build ``` + mkdir build Inside the build folder execute the following commands: -``` cmake .. ``` + cmake .. The default build mode is DEBUG. That is, objects and executables include debug information. The RELEASE build mode optimizes for speed. To build in this mode execute instead -``` cmake .. -DCMAKE_BUILD_TYPE=RELEASE ``` + cmake .. -DCMAKE_BUILD_TYPE=RELEASE The release mode will be kept until next time cmake is executed. -``` make -j $(nproc)``` + make -j $(nproc) In case no errors are reported, the generated libraries (if any) will be located at the _lib_ folder and the executables (if any) will be located at the _bin_ folder. @@ -71,7 +68,7 @@ _lib_ folder and the executables (if any) will be located at the _bin_ folder. In order to be able to use the library, it it necessary to copy it into the system. To do that, execute -``` make install ``` + make install as root and the shared libraries will be copied to */usr/local/lib/iri/project_name* directory and the header files will be copied to */usr/local/include/iri/project_name* directory. At @@ -79,27 +76,27 @@ this point, the library may be used by any user. To remove the library from the system, exceute -``` make uninstall ``` + make uninstall as root, and all the associated files will be removed from the system. To generate the documentation execute the following command: -``` make doc ``` + make doc ## How to use it To use this library in another library or application, in the CMakeLists.txt file, first it is necessary to locate if the library has been installed or not using the following command -``` FIND_PACKAGE(project_name) ``` + FIND_PACKAGE(project_name) In the case that the package is present, it is necessary to add the header files directory to the include directory path by using -``` INCLUDE_DIRECTORIES(${project_name_INCLUDE_DIRS}) ``` + INCLUDE_DIRECTORIES(${project_name_INCLUDE_DIRS}) and it is also necessary to link with the desired libraries by using the following command -``` TARGET_LINK_LIBRARIES(<executable name> ${project_name_LIBRARIES}) ``` + TARGET_LINK_LIBRARIES(<executable name> ${project_name_LIBRARIES}) ## Examples -- GitLab