Menu

CMake cheatsheet

benblan
Attachments
CMake-1.png (47863 bytes)
CMake-2.png (24854 bytes)
CMake-3.png (118187 bytes)

Installation

Linux

Use your OS Packet Manager.
sudo apt install cmake # For Ubuntu

Windows

You can use Chocolatey: https://community.chocolatey.org/packages/cmake

Mac OS

You can use Homebrew :
brew install cmake

How to

CMake is used to generate the build system. You can use either the Gui or the CLI to initiate your system.

CMake GUI

1/ Run Cmake (Gui)

2/ Set "Source code " to the root of the freesynd project where you find the first CMakeLists.txt.
Set "Where to build" to the folder where the result of the build will be.
=> You can have multiple folders, one for Debug and one for Release build for example.

3/ Click Configure.
Select the development platform you want to use (IDE and compiler).

Complete the variables in red if necessary (usually only the CMAKE_BUILD_TYPE with "release" or "debug"

4/ Click Generate. Verify that the project for your IDE is generated in the destination you have set.

CMake CLI

From the CLI, go to the root directory of the Freesynd source and run the following command :

$ cmake -S . -B <build_dir> [-G <generator>]
$ cmake --build <build_dir>

Where :
- <build_dir> is the directory where the building system will be created. Prefix the directory name with "build" so that it is automatically ignored by Git (using existing .ignore file)
- <generator> is the generator named for the building platform you want to use.


Related

Wiki: Dev_Env_Install

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.