ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CMake​Builder

by rwols ST3 OS XLinux

Configure and build a CMake project right from within Sublime Text 3.

Details

Installs

  • Total 60
  • Win 0
  • OS X 23
  • Linux 37
Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 1 3 2 5 0 1 0 2 2 1 1 1 0 3 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 2 0 1 3 1 2 4 3 5 4 0 1 2 2 5 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

CMakeBuilder

Configure and build a CMake project right from within Sublime Text 3.

Instruction Manual

Have a .sublime-project file in your project folder. In that file, create a new dictionary called cmake, as in the following screenshot.

The CMake dictionary item

The cmake dictionary accepts the following keys:

build_folder

The folder where to build the project. If this key is not present in the cmake dictionary, then a temporary folder will be created, and the value of build_folder will be set to that temporary folder. You can always browse the build folder by running the command

CMakeBuilder: Browse Build Folder ...

root_folder (optional)

The folder where the root CMakeLists.txt file resides. If this is not specified, it is assumed that the root folder is the same as the project folder. This setting can be useful if your project is “embedded” into a larger project.

command_line_overrides (optional)

A dictionary of key-value pairs that are passed to the cmake invocation as -D options.

generator (optional)

The generator, passed to the cmake invocation via -G. Currently, only Unix Makefiles and Ninja are supported.

filter_targets (optional)

A list of strings specifying which targets to filter from the list of all targets that may be built. If you have a lot of targets defined, this may be helpful.

Once the sublime project file is populated with the desired cmake settings, you can invoke the command

CMakeBuilder: Configure

from the Command Palette. This will configure the project in the specified builder_folder, and if specified, with the CMakeLists.txt file in root_folder, otherwise the current project path is assumed to have a CMakeLists.txt file.

The CMake dictionary item

Once the project is successfully configured, you can optionally fill your sublime project file with a custom build system derived from the targets generated by cmake. To do this, simply run the command

CMakeBuilder: Write Build Targets to Sublime Project File

from the Command Palette.

The CMake dictionary item

The CMake dictionary item

Now you can enjoy building the correct targets right from Sublime Text 3.

The CMake dictionary item