Overview
CMake is a cross-platform open-source meta-build system which can build, test and package software. It can be used to support multiple native build environments including make, Apple's xcode, and Microsoft Visual Studio.The cmake-examples repository includes some example CMake configurations which I have picked up when exploring it's usage for various projects. The examples are laid out in a tutorial like format. The first examples are very basic and slowly increase in complexity drawing on previous examples to show more complex use cases.
These examples have been tested on Ubuntu 14.04 but should work under any Linux system that supports CMake.
Examples provide include:
- Hello World
- Building and using libraries
- Using an alternative compiler (clang)
- CMake Generators for different build tools (Ninja Build)
- Code Generation
- Static Analysis
- Unit Testing
- Creating Installers
Requirements
The basic requirements for most examples are:- CMake
- A c++ compiler [defaults to gcc]
- make
1 2 | $ sudo apt-get install build-essential $ sudo apt-get install cmake |
-
boost
1sudo
apt-get libboost-all-dev
-
protobuf
12$
sudo
apt-get
install
libprotobuf-dev
$
sudo
apt-get
install
protobuf-compiler
-
cppcheck
1$
sudo
apt-get
install
cppcheck
-
clang
1$
sudo
apt-get
install
clang-3.6
-
Ninja Build
1$
sudo
apt-get
install
ninja-build
No comments:
Post a Comment