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.
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 callingmake
C-C C-r C-t
run unit testC-c C-r C-c
run integration testsC-c C-r C-r
run main executable