CMake Builds with SublimeText and Atom

Both configurations will create a “build” folder for all the cmake generated files.

SublimeText 3

  1. Create a project file or edit your existing one.
  2. 1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    {
    "project_name": "<PROJECT NAME>",
    "folders":
    [
    {
    "path": "."
    }
    ],
    "build_systems":
    [
    {
    "name": "cmake",
    "working_dir": "${project_path}",
    "shell_cmd": "mkdir build ; cd build && cmake .. && make -j8",
    "shell": true
    }
    ]
    }
  3. Use Project -> Open Project from now on instead of opening the folder.

CTRL + B to build.

Atom

  1. Install the Atom Build package
  2. Create a new custom build file in the root of your project folder called .atom-build.json

    1
    2
    3
    4
    5
    6
    {
    "cmd": "mkdir build ; cd build && cmake .. && make -j8",
    "name": "cmake",
    "sh": true,
    "cwd": "{PROJECT_PATH}"
    }
  3. Refresh the build.

    1. CTRL + P
    2. “Build: Refresh Targets”

F9 to build.