You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Make sure the build directory has the same name as value of *cppcm-build-dirname*. It is "build" by default. Make sure the build is located somewhere in the directory hierarchy from C++ file.
48
+
Quick start:
49
+
- The build directory should have the *same name as value of cppcm-build-dirname*. It is "build" by default. Make sure the build is located somewhere in the directory hierarchy from C++ file.
47
50
- Go to build directory to run cmake and make
48
51
- *Done!* Enjoy programming in Emacs as usual.
49
52
50
-
* Plugins (OPTIONAL)
51
-
Let's start by creating a "hello world" C++ project.
52
-
53
-
Execute below command in shell:
53
+
* Demo (OPTIONAL)
54
+
Let's start by creating a "hello world" C++ project:
The command line displayed in minibuffer is `make -C ~/your-projects-blah-blah/hello/build`
66
+
You can also `M-x cppcm-compile` to compile the current excutable only.
72
67
73
-
BTW, you can also `M-x cppcm-compile` to compile the current excutable only.
68
+
** gdb
69
+
Press hotkey `C-c C-g` (I suppose you've copied my setup).
74
70
75
-
You can see the actual command displayed in minibuffer is `make -C ~/your-project-blah-blah/hello/build/sub-project-dir-if-your-are-editing-its-cpp-file`
76
-
** Start gdb
77
-
Press hotkey `C-c C-g` (suppose you've copied my configuration from previous section).
71
+
gud-gdb starts and the binary "~/your-projects-blah-blah/hello/build/main" is loaded automatically.
78
72
79
-
You can see the gud-gdb starts and the executable "~/your-projects-blah-blah/hello/build/main" is loaded automatically.
Press the hotkey `C-x C-o` or `M-x ff-find-other-file`. The corresponding header is opened correctly.
89
-
90
-
This is the default feature of Emacs. What cpputils-cmake does is to set up the directories of those header files for you automatically so that the header files could be found by Emacs.
83
+
Press the hotkey `C-x C-o` or `M-x ff-find-other-file`. The corresponding header is opened.
91
84
92
-
* Advanced Tips
85
+
* FAQ
93
86
** Avoid scanning when opening system header files
94
87
cpputils-cmake scanning is light weight enough so below code is *optional*:
95
88
#+BEGIN_SRC elisp
@@ -101,7 +94,7 @@ cpputils-cmake scanning is light weight enough so below code is *optional*:
101
94
(cppcm-reload-all))
102
95
)))
103
96
#+END_SRC
104
-
** Get executable's full path of executable to build
97
+
** Get executable's full path
105
98
The command "cppcm-get-exe-path-current-buffer" will copy current executable into kill ring AND OS clipboard.
106
99
107
100
You need install `xsel` under Linux to support OS clipboard.
@@ -123,6 +116,7 @@ Here is the list of global variables third party plugins will use (and you can t
The executable's name will be "hello-proj1-a1-a2".
187
181
182
+
** Stop creating Makefiles for flymake
183
+
Insert below code into ~/.emacs:
184
+
#+BEGIN_SRC elisp
185
+
(setq cppcm-write-flymake-makefile nil)
186
+
#+END_SRC
188
187
* Credits
189
188
- [[https://github.com/dojeda][David Ojeda (AKA dojeda)]] developed the algorithm to locate the top level project
190
189
- [[https://github.com/erreina][Ernesto Rodriguez Reina (AKA erreina)]] added the command "cppcm-recompile"
@@ -211,4 +210,4 @@ This program is free software; you can redistribute it and/or modify it under th
211
210
212
211
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
213
212
214
-
You should have received a copy of the GNU General Public License along with this program. If not, see [[http://www.gnu.org/licenses/]].
213
+
You should have received a copy of the GNU General Public License along with this program. If not, see [[http://www.gnu.org/licenses/]].
0 commit comments