Meeting 08: Building Cross-Platform Software using CMake

The goal of today's meeting it to learn about building larger software projects that have multiple modules of code, unit tests, and main programs.

Links:

Exercise 08: Basic CMake

GitHub Invitation URL: exercise8

Steps:

  1. Create a working directory somewhere on your computer, then change to that directory.
  2. Clone the assignment for today after accepting the GitHub invitation at the link above.

    git clone https://github.com/VTECE3574/exercise08-USER.git

    where USER is your GitHub username. You may have to enter your GitHub username and password.

  3. Examine the repository. There is a small set of source files in the repository that implement a simple module of code, a unit test for it, and a program that uses the module.

    • treap_bst.h and treap_bst.txx implement a templated binary search tree using a data structure known as a treap.
    • test_treap.cpp is an incomplete set of tests for the treap that uses catch. The test can be build from the files: catch.hpp test_treap.cpp treap_bst.h treap_bst.txx
    • compress.cpp implements a simple compression/decompression program using the treap BST. It can be built from the files: compress.cpp treap_bst.h treap_bst.txx
  4. Write a CMakeLists.txt file to build the unit test and the program.

  5. Configure the project using CMake, compile the project, and run the unit tests on your host platform.

  6. Now, use git to commit the CMakeLists.txt file you added to the local repository.

  7. Finally, use git push to synchronize the repository with that on GitHub.

You have completed the Exercise.