Giter Site home page Giter Site logo

training-cmake-basics's Introduction

⚙️ The basics of CMake

📖 Primer

For completing this course you need to have installed on your machine:

  • CMake
  • Any c++ compiler
  • A text editor(an IDE is recommended)

Windows(WSL)

⚠️ Disclaimer: for licenses issues and in order to uniform the instructions respect to the linux procedure this hands-on can be done on Windows using the Windows Subsystem for Linux(WSL).

Once it has been installed correctly simply follow the instructions for linux.

It may be better to use a text editor to follow the hands on, then I suggest you to see these instructions to run graphical applications on WSL.

Linux

  • Get the c++ compiler, open a terminal and type:
  $ sudo apt-get install build-essential
  • Get cmake:
  $ sudo apt-get install cmake
  • Get cmake gui(optional but highly recommended):
  $ sudo apt-get install cmake-curses-gui
  • Get the text editor(optional but highly recommended):
  $ sudo apt-get install geany

Actually you can install the whatever text editor you like (e.g. kate, gedit, nano, vim, atom, vs-code).

📝 Hands-on

The hands-on consist in the compilation of a simple executable that given 2 numbers (15 and 10), calculate the sum and the differece. Follow these steps:

  1. Open the CMakeLists.txt and fill all the TODO sections, following the teacher instructions.
  2. Once finished and saved create the build directory: $ mkdir build
  3. Enter in the build directory: $ cd build
  4. Configure and generate the makefiles: $ cmake ..
  5. Compile your program: $ make
  6. Run: ./myExecutable

The output should be:

Executable standalone example
The operators are: 15 and 10
The sum is: 25
The difference is: 5

if everything is fine you have to commit your work then:

$ git commit -am "My hands on works!"
$ git push origin master

ℹ This repository contains the material required for the training on basics of CMake.

training-cmake-basics's People

Contributors

nicogene avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.