Code Monkey home page Code Monkey logo

cmake-tutorial's Introduction

cmake-tutorial

Hands-on exercises for a brief CMake tutorial.

The exercises are adapted from the dev-cafe/cmake-cookbook repository and the CodeRefinery CMake lesson.

CMake Cookbook offers a more in-depth discussion of many additional topics.

Introductory slides are rendered here.

Introduce basic CMake commands to successfully compile a project. We will also show how to work with dependencies and switch generators.

Commands discussed:

  • project
  • cmake_minimum_required
  • message
  • set
  • option
  • if
  • add_executable
  • find_package
  • target_link_libraries
  • target_sources

We will discuss how to structure a project and how to produce libraries, in addition to executables.

Commands discussed:

  • add_library

We will have a first look at the Catch2 unit test framework and how to use it with CTest.

CMake is not just for C/C++, it can be used also for Fortran projects. In this example we will build a C++/Fortran project. We will also get acquainted with CTest, the testing framework that is part of the CMake suite.

This final example will focus on unit testing and present some of the available C++ frameworks. We will focuse on Catch2 and introduce some of its features.

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.