Skip to content
Snippets Groups Projects
fherrero's avatar
Fernando Herrero authored
Add usage text. Check name has no whitespaces. Do not create bin and lib directories. Add CMakeLists plural variables _DIRS, _LIBRARIES, add gitlab-ci.yml file.
6dc74faf
History

project template

Description

This repository provides a simple way to create a fully functional C++ project using the CMake tool. It allows to create to different kind of projetcs:

  • library: the final result is a shared library that can be used by other libraries or applications. It also includes a simple executable to demonstrate the use of the generated library.

  • application: the final result is an executable.

The script allows to select the name of the desired library or executable, together with a brief description and a list of other system or IRI dependencies. Additionally, it also provides an option to include a basic test framework using the [googletest](https://github.com/google/googletest GoogleTest github page) software.

Dependencies

This package does not have any dependencies.

How to use it

Clone the repository to the desired location.

Execute the new_project.sh script with the following parameters:

  • -t project_type: this parameter is required. It specifies which kind of project is to be created. At the moment, only two project types types are allowed:

  • library: generates the necessary structure to create a shared library that can be used in other driver or applications.

  • application: generates the necessary structure to create a binary file.

  • -p project_description: this parameter is required. It provides a short description of the project. This parameter will appear in all the associated documentation. For multi-word values, use the double quote.

  • -n project_name: this parameter is required. It specifies the name of the shared library or the binary file to be generate by the project. This parameter must not have any whitespace characters.

  • -d comma_separated_dependencies: this parameter is optional. It specifies a set of dependencies of the library or application being generated. These depedencies will be automatically included inside the CMake structure. Only dependencies supported by the CMake framework are currently supported.

  • -g: this parameters is optional. Is specifies whether the test strcture is to be included into the project or not. This includes the necessaty CMake files to download and locally build the google test software and a basic test file for the generated project.

After executing the script, all the temporary and template files are removed, as well as the link to the remote GIT repository, so that the new project can be easily associated to another repository.

Disclaimer

Copyright (C) 2009-2018 Institut de Robòtica i Informàtica Industrial, CSIC-UPC. Mantainer labrobotica (labrobotica@iri.upc.edu)

This package is distributed in the hope that it will be useful, but without any warranty. It is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. should the program prove defective, the GMR group does not assume the cost of any necessary servicing, repair or correction.

In no event unless required by applicable law the author will be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if the author has been advised of the possibility of such damages.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/