1
0
mirror of synced 2024-11-12 16:08:53 +01:00
modern-cmake/examples/extended-project
2020-11-18 11:53:02 -05:00
..
apps style: update style 2020-08-03 18:16:52 -04:00
cmake style: update style 2020-08-03 18:16:52 -04:00
docs style: update style 2020-08-03 18:16:52 -04:00
include/modern style: update style 2020-08-03 18:16:52 -04:00
src style: update style 2020-08-03 18:16:52 -04:00
tests fix: names need to match to share fetches 2020-08-05 16:19:05 -04:00
.gitignore Adding extended example 2019-08-07 05:06:55 +00:00
CMakeLists.txt chore: bump to 3.19.0 2020-11-18 11:53:02 -05:00
README.md Adding extended example 2019-08-07 05:06:55 +00:00

This is an example project using CMake.

The requirements are:

  • CMake 3.11 or better; 3.14+ highly recommended.
  • A C++17 compatible compiler
  • The Boost libararies (header only part is fine)
  • Git
  • Doxygen (optional)

To configure:

cmake -S . -B build

Add -GNinja if you have Ninja.

To build:

cmake --build build

To test (--target can be written as -t in CMake 3.15+):

cmake --build build --target test

To build docs (requires Doxygen, output in build/docs/html):

cmake --build build --target docs

To use an IDE, such as Xcode:

cmake -S . -B xbuild -GXcode
cmake --open xbuild

The CMakeLists show off several useful design patters for CMake.