Skip to content
/ cppext Public

Some extensions for working with CMake based projects for Emacs.

License

Notifications You must be signed in to change notification settings

mmatthe/cppext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CppExt - Emacs package for some extra functionality for using C++

1 Overview

This package provides some extra functionality for working with CMake based projects. It offers

  • Compilation and running of targets: Set up your compilation and working dir in a .dir-locals file and execute the corresponding targets or tests by simple commands.
  • Add a member function to a C++-class. Automatic generation of declaration and implementation, includig correct signature.
  • aid TDD for C++ by adding yasnippets for creating a test case / test fixture for google test and automatically creating git commit messages.

2 Functions for running and compiling the project

Add a .dir-locals to the project root directory, that sets the following variables:

((nil . ((cppext/proj-root-dir . "/your/source/root/dir")
         (cppext/proj-build-dir . "/where/to/call/make")

         (cppext/work-dir . "pwd/for/executables/relative/to/proj-root-dir/")
         (cppext/main-exec .
                           ("target1 --param A --param B"
                            "target2 --param C --param D"))

         (cppext/test-dir . "pwd/for/tests/rel/to/build-dir")
         (cppext/unit-test-exec . "command/to/execute/unittests")
         (cppext/integration-test-exec . "command/to/execute/integration-tests"))
      ))
  • proj-root-dir is the source root directory
  • proj-build-dir is the dir where cmake was run and make will be run to compile the project
  • main-exec, unit-test-exec, integration-test-exec determine commands for executing main targets, unit test targets and integration test targets. They can either be a list of commands or a signle command. User will be asked for a selection, if several elements are in the list.

By default, the following bindings are allocated in Cpp-mode files

  • C-c C-c compile project by changing to build-dir and calling make
  • C-C C-r C-t run unit test
  • C-c C-r C-c run integration tests
  • C-c C-r C-r run main executable

3 Function to add a member function to a class

4 Function to automatically create a git commit-message

About

Some extensions for working with CMake based projects for Emacs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published