build-cmake

Generate and build cmake projects from within Atom.

siegelaaron94

35,924

21

0.12.0

MIT

GitHub

This package provides the following services:

CMake build system for Atom

Dependencies

This package requires the atom-build to be installed.

Preview

preview

Configuration

Default Configuration

By default four different build configurations are supported, Debug, Release, RelWithDebInfo, and MinSizeRel all using the default CMake generator for you platform. Basic default generation and build settings such as build location, cmake arguments, and build tool arguments can be configured in the project settings, for more advanced configuration see the Custom Configuration section.

Custom Configuration

Custom configuration options can be defined in a file called CMakeSettings.json at the root of your project folder. The name and schema of this file was intentionally created to match Visual Studio 15 2017's implementation.

Here is an example CMakeSettings.json file.

{
  "configurations": [
    {
      "name": "Debug",
      "generator": "Unix Makefiles",
      "configurationType" : "Debug",
      "buildRoot":  "${projectDir}/build/${name}",
      "cmakeCommandArgs":  "",
      "buildCommandArgs": "",
      "ctestCommandArgs":  "",
      "variables": [{
        "name": "TEST_VAR",
        "value": "ON"
        }]
    },
    {
      "name": "Release",
      "generator": "Unix Makefiles",
      "configurationType" : "Release",
      "buildRoot": "${projectDir}/build/${name}",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": ""
    }
  ]
}

A configuration is an JSON object containing the fields.

A string that describes the current configuration.

A string containing one of the CMake generators to use for the current configuration.

A string with one of the values; Debug, Release, RelWithDebInfo, or MinSizeRel.

A string containing the build location for the current configuration, this field supports variable replacement.

A string of extra arguments to pass to CMake, this field supports variable replacement.

A string of extra arguments to pass to the build tool, this field supports variable replacement.

This string value is ignored for now.

A list of objects that define a variable to be passed to CMake equivalent to -Dname=value.

Variable Replacement

The following variable substitutions will be made on the configuration fields that are marked as supporting variable replacement.