All Projects β†’ rwols β†’ CMakeBuilder

rwols / CMakeBuilder

Licence: MIT License
Configure, build and test a CMake project right from within Sublime Text 3.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to CMakeBuilder

Ayu
πŸŽ¨πŸ–Œ Modern Sublime Text theme
Stars: ✭ 3,933 (+14466.67%)
Mutual labels:  sublime, sublime-text-3
eRCaGuy dotfiles
.bashrc file, terminal prompt that shows current git branch, Arduino setup, Eclipse setup, git diff with line numbers, helpful scripts, improved Linux productivity, etc.
Stars: ✭ 84 (+211.11%)
Mutual labels:  sublime, sublime-text-3
Sublimeallautocomplete
Extend Sublime autocompletion to find matches in all open files of the current window
Stars: ✭ 906 (+3255.56%)
Mutual labels:  sublime, sublime-text-3
Coffeescript Sublime Plugin
Syntax highlighting and checking, commands, shortcuts, snippets, compilation and more.
Stars: ✭ 296 (+996.3%)
Mutual labels:  sublime, sublime-text-3
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-48.15%)
Mutual labels:  sublime, sublime-text-3
Carbonsublime
πŸš€ A Sublime Text 3 Plugin for Carbon. (https://carbon.now.sh)
Stars: ✭ 104 (+285.19%)
Mutual labels:  sublime, sublime-text-3
Productive Sublime Snippets Ruby
Ruby Snippets for Sublime Text
Stars: ✭ 109 (+303.7%)
Mutual labels:  sublime, sublime-text-3
Nord Sublime Text
An arctic, north-bluish clean and elegant Sublime Text theme.
Stars: ✭ 109 (+303.7%)
Mutual labels:  sublime, sublime-text-3
sublime
Repository for the Tandem Sublime Plugin
Stars: ✭ 22 (-18.52%)
Mutual labels:  sublime, sublime-text-3
Css3
The most complete CSS support for Sublime Text
Stars: ✭ 178 (+559.26%)
Mutual labels:  sublime, sublime-text-3
Milotic
Color Full Theme for All Text Editors!
Stars: ✭ 23 (-14.81%)
Mutual labels:  sublime, sublime-text-3
sublime-live-server
🌍️ Launch a Development Server directly from Sublime Text
Stars: ✭ 49 (+81.48%)
Mutual labels:  sublime, sublime-text-3
Nineties
πŸ’Ύ Colors for World Wide Web pioneers
Stars: ✭ 16 (-40.74%)
Mutual labels:  sublime, sublime-text-3
sublime-evernote
Open and Save Evernote notes from Sublime Text 3 using Markdown
Stars: ✭ 1,164 (+4211.11%)
Mutual labels:  sublime-text-3
sublime-patcher
Bash script for patching/cracking Sublime Text on Linux
Stars: ✭ 20 (-25.93%)
Mutual labels:  sublime-text-3
one-themes
One Dark and One Light Themes
Stars: ✭ 14 (-48.15%)
Mutual labels:  sublime
sublime-text
Subime Text 相关衄源攢集整理
Stars: ✭ 62 (+129.63%)
Mutual labels:  sublime-text-3
ubuntu-win-bootstrap
DEPRECIATED! Use "linux-comfy-chair" instead. A very simple bootstrap script to install some development tools to the Windows 10 Ubuntu Bash system - Ruby, Perl, Python, Node, Sublime Text and more!
Stars: ✭ 27 (+0%)
Mutual labels:  sublime
StGitlab
Sublime text Gitlab manager
Stars: ✭ 13 (-51.85%)
Mutual labels:  sublime
wollok
Wollok Programming Language
Stars: ✭ 54 (+100%)
Mutual labels:  sublime

CMakeBuilder

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

Installation

Run the command

Package Control: Install Package

and look for CMakeBuilder.

Version 1.0.1 and lower do not have server functionality. What follows is the documentation for version 1.0.1 and lower.

TL;DR

  1. Open a .sublime-project.

  2. Add this to the project file in your "settings":

    "cmake":
    {
       "build_folder": "$folder/build"
    }
  3. Run the command "CMakeBuilder: Configure" from the command palette.

  4. Check out your new build system in your .sublime-project.

  5. Press CTRL + B or ⌘ + B.

  6. Hit F4 to jump to errors and/or warnings.

See the example project below for more options.

Reference

The CMake Dictionary

By "CMake dictionary" we mean the JSON dictionary that you define in your "settings" of your sublime project file with key "cmake". The CMake dictionary accepts the following keys:

  • build_folder [required string]

    A string pointing to the directory where you want to build the project. A good first choice is $folder/build.

  • command_line_overrides [optional dictionary]

    A dictionary where each value is either a string or a boolean. The key-value pairs are passed to the CMake invocation when you run cmake_configure as -D options. For example, if you have the key-value pair "MY_VAR": "BLOB" in the dictionary, the CMake invocation will contain -D MY_VAR=BLOB. Boolean values are converted to ON or OFF. For instance, if you have the key-value pair "BUILD_SHARED_LIBS": truein the dictionary, the CMake invocation will contain -D BUILD_SHARED_LIBS=ON.

  • generator [optional string]

    A JSON string specifying the CMake generator.

    • Available generators for osx: "Ninja" and "Unix Makefiles".

      If no generator is specified on osx, "Unix Makefiles" is the default generator. For "Ninja", you must have ninja installed. Install it with brew.

    • Available generators for linux: "Ninja" and "Unix Makefiles".

      If no generator is specified on linux, "Unix Makefiles" is the default generator. For "Ninja", you must have ninja installed. Install it with your package manager.

    • Available generators for windows: "Ninja" and "Visual Studio".

      If no generator is specified on windows, "Visual Studio" is the default generator. You need Microsoft Visual Studio C++ in order to configure your project wether you're using Ninja or Visual Studio.

  • root_folder [optional string]

    The directory where the root CMakeLists.txt file resides. If this key is not present, the directory where the sublime project file is located is assumed to have the root CMakeLists.txt file.

  • env [optional dictionary]

    This is a dict of key-value pairs of strings. Place your environment variables at configure time in here. For example, to select clang as your compiler if you have gcc set as default, you can use

    "env": { "CC": "clang", "CXX": "clang++" }
    
  • platform [optional string]

    For generators that support a platform argument. In the case of this plugin that would be Visual Studio. In practise, set this to "x64" to build 64-bit binaries instead of the default 32-bit. This is the -A argument passed to CMake.

  • toolset [optional dictionary]

    For generators that support a toolset argument. In the case of this plugin that would be Visual Studio. In practise, set this to { "host": "x64" } to use the 64-bit compiler instead of the 32-bit compiler. This is the -T argument passed to CMake. As in the case of command_line_overrides, the dictionary is converted into a string as in key1=value1;key2=value2.

  • vs_major_version [optional integer]

    When using the Ninja generator on Windows, by default it will use the most recent Visual Studio SDK on the system. If you need another SDK, define the vs_major_version number to be 15 or 16.

Any key may be overridden by a platform-specific override. The platform keys are one of "linux", "osx" or "windows". For an example on how this works, see below.

Example Project File

Here is an example Sublime project to get you started.

{
    "folders":
    [
        {
            "path": "."
        }
    ],
    "settings":
    {
        "cmake":
        {
            "build_folder": "$folder/build",
            "command_line_overrides":
            {
                "BUILD_SHARED_LIBS": true,
                "CMAKE_BUILD_TYPE": "Debug",
                "CMAKE_EXPORT_COMPILE_COMMANDS": true
            },
            "generator": "Unix Makefiles",
            "windows":
            {
                "generator": "Visual Studio 15 2017",
                "platform": "x64",
                "toolset": { "host": "x64" }
            }
        }
    }
}

Available Scripting Commands

  • cmake_clear_cache, arguments: { with_confirmation : bool }.
  • cmake_configure, arguments: None.
  • cmake_diagnose, arguments: None.
  • cmake_open_build_folder, arguments: None.

Available Commands in the Command Palette

  • CMakeBuilder: Clear Cache
  • CMakeBuilder: Configure
  • CMakeBuilder: Diagnose
  • CMakeBuilder: Browse Build Folder...

All commands are accessible via both the command palette as well as the tools menu at the top of the window.

Available Settings

  • silence_developer_warnings : JSON bool

    If true, will add the option -Wno-dev to the CMake invocation of the cmake_configure command.

  • always_clear_cache_before_configure : JSON bool

    If true, always clears the CMake cache before the cmake_configure command is run.

  • ctest_command_line_args : JSON string

    Command line arguments passed to the CTest invocation when you run cmake_run_ctest.

Clearing the cache

To force CMake files re-generation run

CMakeBuilder: Clear Cache

and then run

CMakeBuilder: Configure

Diagnostics/Help

If you get stuck and don't know what to do, try running

CMakeBuilder: Diagnose

Tools Menu

All commands are also visible in the Tools menu under "CMakeBuilder".

11

Running unit tests with CTest

If you have unit tests configured with the add_test function of CMake, then you can run those with the "ctest" build variant.

Using multiple cores with make

This package invokes cmake --build to build your targets. If you are using the "Unix Makefiles" generator (make), and you want to use multiple cores, then you have a few options:

  • Don't use make, instead use ninja.
  • Put "env": {"CMAKE_BUILD_PARALLEL_LEVEL": 8} as an environment variable in the "cmake" configuration.
  • Export a MAKEFLAGS variable in your .bashrc.

Syntax highlighting for various generators

There is syntax highlighting when building a target, and a suitable line regex is set up for each generator so that you can press F4 to go to an error.

9 10 12

List of Valid Variable Substitutions

This is a reference list for the valid variable substitutions for your .sublime-project file.

  • packages
  • platform
  • file
  • file_path
  • file_name
  • file_base_name
  • file_extension
  • folder
  • project
  • project_path
  • project_name
  • project_base_name
  • project_extension
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].