All Projects → atilaneves → Cmake Ide

atilaneves / Cmake Ide

Licence: bsd-3-clause
Use Emacs as a C/C++ IDE

Programming Languages

cpp
1120 projects
cpp11
221 projects
cpp17
186 projects
cpp14
131 projects

Projects that are alternatives of or similar to Cmake Ide

Irony Mode
A C/C++ minor mode for Emacs powered by libclang
Stars: ✭ 851 (+28.74%)
Mutual labels:  clang, libclang, emacs
Ide Stubs
Phalcon IDE Stubs
Stars: ✭ 137 (-79.27%)
Mutual labels:  ide, autocomplete, autocompletion
Easyclangcomplete
💥 Robust C/C++ code completion for Sublime Text 3
Stars: ✭ 537 (-18.76%)
Mutual labels:  cmake, clang, libclang
TheVimIDE
Modern Vim IDE with support for C/C++, Java, Python, Lua, PHP, JavaScript, Ruby and much more ...
Stars: ✭ 33 (-95.01%)
Mutual labels:  autocompletion, ide, clang
Rg.el
Emacs search tool based on ripgrep
Stars: ✭ 277 (-58.09%)
Mutual labels:  emacs, melpa
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (-59.91%)
Mutual labels:  cmake, clang
Clangd
clangd language server
Stars: ✭ 293 (-55.67%)
Mutual labels:  clang, ide
Cpp Reflection
C++ Reflection Parser / Runtime Skeleton
Stars: ✭ 440 (-33.43%)
Mutual labels:  cmake, libclang
cide
A fast, lightweight C/C++ IDE for Linux and Windows
Stars: ✭ 33 (-95.01%)
Mutual labels:  libclang, ide
Use Package
A use-package declaration for simplifying your .emacs
Stars: ✭ 3,748 (+467.02%)
Mutual labels:  emacs, melpa
Tprpix
a Cross-Platform, 2D Survival Sandbox Game Project. Based on C++17/cmake/OpenGL/SQLite3.
Stars: ✭ 448 (-32.22%)
Mutual labels:  cmake, clang
AndroidIDE
AndroidIDE is an IDE for Android to develop full featured Android apps on Android smartphones.
Stars: ✭ 98 (-85.17%)
Mutual labels:  autocomplete, ide
yii2-autocomplete-helper
Yii2 IDE Autocomplete Helper
Stars: ✭ 38 (-94.25%)
Mutual labels:  autocompletion, ide
Php Ide Serenata
Atom IDE package that integrates the Serenata server to provide PHP code assistance
Stars: ✭ 277 (-58.09%)
Mutual labels:  ide, autocompletion
flycheck-dmd-dub
flycheck and DCD dub support to enable D IDE features in Emacs
Stars: ✭ 14 (-97.88%)
Mutual labels:  ide, melpa
Nord Emacs
An arctic, north-bluish clean and elegant Emacs theme.
Stars: ✭ 379 (-42.66%)
Mutual labels:  emacs, melpa
Portacle
A portable common lisp development environment
Stars: ✭ 494 (-25.26%)
Mutual labels:  ide, emacs
Cmake Examples
Useful CMake Examples
Stars: ✭ 7,220 (+992.28%)
Mutual labels:  cmake, clang
Javascriptenhancements
JavaScript Enhancements is a plugin for Sublime Text 3. It offers not only a smart javascript autocomplete but also a lot of features about creating, developing and managing javascript projects (real-time errors, code refactoring, etc.).
Stars: ✭ 592 (-10.44%)
Mutual labels:  ide, autocomplete
bootstrap
Bootstrap Go bindings for Clang's C API
Stars: ✭ 18 (-97.28%)
Mutual labels:  libclang, clang

cmake-ide

Build Status Coverage Status Melpa Status

CppCon 2015 Lightning talk on cmake-ide:

CppCon 2015 Lightning talk on cmake-ide

Introduction

cmake-ide is a package to enable IDE-like features on Emacs for CMake projects. It also supports non-CMake projects as long as a compilation database is generated out-of-band.This includes autocompletion and on-the-fly syntax checking in Emacs for CMake projects with minimal configuration. It uses other packages to do its heavy lifting, in a combination of:

cmake-ide will set variables and call functions for the installed dependent packages.

It works by running CMake in Emacs in order to obtain the necessary compiler flags to pass to the other tools. Since all the dependencies are specified in the CMake scripts, there is no need to maintain a parallel dependency tracking system for Emacs. Just ask CMake.

Features

  • Sets variables for auto-complete-clang, flycheck and others for a CMake project automagically. Hardly any configuration necessary.
  • Automatically reruns CMake when a file is saved. Great when using CMake file globs to pick up newly created files, but needs cmake-ide-build-dir to be set.
  • cmake-ide-delete-file allows you to have the same convenience when deleting files. I can't figure out a better way to do this. Obviously simply deleting the file means having to run CMake again manually for it to register the change in the list of files to be compiled.
  • If cmake-ide-build-dir is set, it is considered to be the build directory to run CMake in. Additionally, this will cause cmake-ide-compile to compile the project there. It automatically detects Ninja and Make builds and sets the compile command accordingly. The command to use can be customised by setting the cmake-compile-command variable.
  • cmake-ide can make usage of rtags for finding definitions, also using clang. If (require 'rtags) is called before cmake-ide-setup, it will automatically start the rtags server (rdm) and call rc -J to index the project files for 0-config "jump to definition" and everything else rtags offers. This only works if both rdm and rc and in the system path or if cmake-ide-rdm-executable and cmake-ide-rc-executable are customized correctly.

Build Pool Directories and Persistent Naming of Automatic Build Directories

cmake-ide can automatically create build directories for you -- either in the system's tmp-directory or under cmake-ide-build-pool-dir (if set). By default, all automatically created build directories (no matter where created) will have temporary and unique names, that will change with each new session and are thus not reusable. You can, however, by setting cmake-ide-build-pool-use-persistent-naming use a reproducible naming scheme that is based on the project's path and will not change as long as the project's path is the same. This way, you can reuse the build directory.

By using both cmake-ide-build-pool-dir and cmake-ide-build-pool-use-persistent-naming, you can fully do away with the need to configure a build directory per project with directory local variables (for example).

Non-CMake projects

Use .dir-locals.el to set the cmake-ide-project-dir and cmake-ide-build-dir variables (use absolute paths).

.dir-locals.el: ((nil . ((cmake-ide-build-dir . "/path/to/build/dir") (cmake-ide-project-dir . "/path/to/project/dir"))))

If a file called compile_commands.json exists in cmake-ide-build-dir, it will work just as well as for CMake projects. Bear (https://github.com/rizsotto/Bear) can be used to generate a compile_commands.json from a make command.

Installation

Install from MELPA or MELPA Stable with:

M-x package-install RET cmake-ide.

Usage

Add this to your .emacs / init.el:

(require 'rtags) ;; optional, must have rtags installed
(cmake-ide-setup)

If cmake-ide-flags-c or cmake-ide-flags-c++ are set, they will be added to ac-clang-flags and company-clang-arguments. These variables should be set. Particularly, they should contain the system include paths (e.g. '("-I/usr/include/c++/4.9.1" "..."). For a system with gcc, you can get this information by running gcc -v -xc++ /dev/null -fsyntax-only (it's the same prerequisite for auto-complete-clang to work, since that's how clang itself works).

And... that's it. It works by calling cmake and parsing the resulting JSON file with compiler flags. Set cmake-ide-build-dir to where your project is being built and you won't have to call CMake manually again (except for the first time to specify options). Best done with directory local variables.

Related Projects:

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].