Skip to content

Commit dfcb2fa

Browse files
committed
Getting Started documentation update.
* Put Core Build and Managed Build items in separate topics. * Added two images to Creating a CMake project. * Added new pages about creating a CBS Makefile project, using existing code, launch bar, building, running, and debbuggin a project. * Renamed "Creating a simple application" to "Creating a Managed Build System Makefile project" and replaced two images. * Removed "Creating a Makefile project", because it was duplicate information. Fixes #992
1 parent 0fcf41a commit dfcb2fa

34 files changed

+587
-199
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
////
2+
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
////
10+
11+
// pull in shared headers, footers, etc
12+
:docinfo: shared
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: ../../images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
// enable support for button, menu and keyboard macros
22+
:experimental:
23+
24+
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
25+
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
26+
// that the checked in html is up to date.
27+
// do_generate_asciidoc.sh can also be used to apply this header to all the
28+
// adoc files.
29+
// ENDOFHEADER
30+
31+
== Building a project
32+
33+
During Core Build System (CBS) project creation a launch configuration
34+
with the same name is created along with it. The Build settings are
35+
managed in the *Build Settings* tab of the launch configuration.
36+
37+
CBS projects rely on the xref:cbs_launchbar.adoc[Launch Bar]. Make
38+
sure the launch bar is installed and enabled.
39+
40+
=== Building for Run
41+
42+
. Select the launch configurion of the project you want to build.
43+
. Select launch mode *Run*.
44+
. Press the *Build* button in the launch bar.
45+
. Inspect the build output in the Console window.
46+
. Find the build results in the Project Explorer.
47+
48+
image:cbs_build.png[Build a project for Run]
49+
50+
=== Building for Debug
51+
52+
To build for Debug:
53+
54+
. Select the launch configurion of the project you want to build.
55+
. Select launch mode *Debug*.
56+
. Press the *Build* button.
57+
. Inspect the build output in the Console window.
58+
. Find the build results in the Project Explorer.
59+
60+
image:cbs_build_debug.png[Build a project for Debug]
61+
62+
=== Changing build settings
63+
64+
The launch configuration presents separate build settings for launch mode
65+
Run and Debug. You will see the build settings depending on the selected
66+
launch mode.
67+
68+
To change Run build settings:
69+
70+
. Set the launch mode to *Run*
71+
. Edit the project's launch configuration. Click on the gear icon.
72+
73+
image:cbs_edit_launch_config_run.png[Edit launch configuration]
74+
75+
The edit launch configuration wizard will open. Select the *Build
76+
Settings* tab.
77+
78+
The only settings that can be changed are the build chain, and how
79+
CMake or Make is called. There are no options to set pre-processor
80+
symbols or include paths. This makes that the project can easily be
81+
shared with other IDEs, command line, or continuous integration flows.
82+
83+
The following picture shows the build settings of a CMake project.
84+
85+
image:cbs_build_settings_tab_cmake.png[CMake build settings tab]
86+
87+
=== Makefile projects BUILD_MODE
88+
89+
For CBS Makefile projects the launch mode is passed to `make` via
90+
environment variable `BUILD_MODE`. In the Makefile you can make use of
91+
this variable to set the wanted `CFLAGS` per launch mode.
92+
93+
[cols="1,1"]
94+
|===
95+
|Launch mode | BUILD_MODE
96+
97+
|Run
98+
|run
99+
100+
|Debug
101+
|debug
102+
|===
103+
104+
Here is some example code that makes use of `BUILD_MODE` to set the
105+
wanted `CFLAGS`:
106+
107+
[source,makefile]
108+
----
109+
ifeq ($(BUILD_MODE),debug)
110+
CFLAGS += -g -O0
111+
else ifeq ($(BUILD_MODE),run)
112+
CFLAGS += -O2
113+
endif
114+
----
115+
116+
icon:arrow-circle-right[] xref:cbs_run_project.adoc[Next: Running a project]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
////
2+
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
////
10+
11+
// pull in shared headers, footers, etc
12+
:docinfo: shared
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: ../../images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
// enable support for button, menu and keyboard macros
22+
:experimental:
23+
24+
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
25+
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
26+
// that the checked in html is up to date.
27+
// do_generate_asciidoc.sh can also be used to apply this header to all the
28+
// adoc files.
29+
// ENDOFHEADER
30+
31+
== Debugging a project
32+
33+
Debugging a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make
34+
sure the launch bar is installed and enabled.
35+
36+
First build the project for Debug.
37+
See xref:cbs_build_project.adoc[Building a project].
38+
39+
. Select the launch configuration of the project you want to run.
40+
. Select launch mode *Debug*.
41+
. Press the *Debug* button in the launch bar.
42+
. Confirm the switch to the Debug Perspective.
43+
44+
image:cbs_debug_cmake.png[Launch a CMake project for Debug]
45+
46+
The Perspective will change to *Debug*, and you can start debugging.
47+
48+
image:cbs_debugging.png[Debugging a CMake project]
49+
50+
51+
=== Changing debug settings
52+
53+
To change debug settings:
54+
55+
. Set the launch mode to *Debug*
56+
. Edit the project's launch configuration. Click on the gear icon.
57+
58+
image:cbs_edit_launch_config_debug.png[Edit launch configuration]
59+
60+
The edit launch configuration wizard will open. Notice that there are
61+
now two extra tabs *Debugger* and *Source*, because the launch mode is
62+
*Debug*. These are not present in launch mode *Run*.
63+
64+
On the *Main* tab you can set an alternative C/C++ application, and
65+
you can enable or disable build before launch.
66+
67+
On the *Arguments* tab you specify optional arguments, and you can
68+
change the working directory.
69+
70+
On the *Environment* tab you define optional environment variables.
71+
72+
On the *Debugger* tab you can set an alternative debugger. If the
73+
debugger name is not an absolute path, CDT will look first for the
74+
debugger in the selected toolchain in the *Build Settings* tab. When
75+
it is not found in the toolchain the debugger is searched in the
76+
*PATH* environment variable defined locations.
77+
78+
On the *Source* tab extra paths outside the project folder can be
79+
defined to look for source code.
80+
81+
image:cbs_launch_config_tab_debug.png[Launch configuration debug tab]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
////
2+
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
////
10+
11+
// pull in shared headers, footers, etc
12+
:docinfo: shared
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: ../../images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
// enable support for button, menu and keyboard macros
22+
:experimental:
23+
24+
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
25+
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
26+
// that the checked in html is up to date.
27+
// do_generate_asciidoc.sh can also be used to apply this header to all the
28+
// adoc files.
29+
// ENDOFHEADER
30+
31+
== Launch Bar
32+
33+
Core Build System (CBS) projects rely on the *Launch Bar*. Make sure
34+
the _LaunchBar UI_ feature is installed and enabled. In the global
35+
preferences the launch bar can be enabled or disabled.
36+
37+
image:launchbar_preferences.png[Launch Bar preferences]
38+
39+
The launch bar exists out of several components:
40+
41+
image:launchbar.png[Launch Bar]
42+
43+
. Build button, to launch a build.
44+
. Run button, to launch a run. This button will change to a Debug
45+
button in Debug mode.
46+
. Stop button, to stop a Run or Debug session.
47+
. Launch mode selector. To change between Run and Debug mode.
48+
. Launch configuration selector.
49+
. Edit launch configuration. To change the launch configuration
50+
properties.
51+
. Target selector. Not always visible.
52+
. Edit target.
53+
54+
icon:arrow-circle-right[] xref:cbs_build_project.adoc[Next: Building a
55+
project]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
////
2+
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
////
10+
11+
// pull in shared headers, footers, etc
12+
:docinfo: shared
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: ../../images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
// enable support for button, menu and keyboard macros
22+
:experimental:
23+
24+
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
25+
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
26+
// that the checked in html is up to date.
27+
// do_generate_asciidoc.sh can also be used to apply this header to all the
28+
// adoc files.
29+
// ENDOFHEADER
30+
31+
== Running a project
32+
33+
Running a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make
34+
sure the launch bar is installed and enabled.
35+
36+
First build the project for Run.
37+
See xref:cbs_build_project.adoc[Building a project].
38+
39+
. Select the launch configuration of the project you want to run.
40+
. Select launch mode *Run*.
41+
. Press the *Run* button in the launch bar.
42+
. Inspect the program output in the Console window.
43+
44+
image:cbs_run_cmake.png[Launch a CMake project for Run]
45+
46+
=== Changing run settings
47+
48+
To change run settings:
49+
50+
. Set the launch mode to *Run*
51+
. Edit the project's launch configuration. Click on the gear icon.
52+
53+
image:cbs_edit_launch_config_run.png[Edit launch configuration]
54+
55+
The edit launch configuration wizard will open.
56+
57+
On the *Main* tab you can set an alternative C/C++ application, and
58+
you can enable or disable build before launch.
59+
60+
On the *Arguments* tab you specify optional arguments, and you can
61+
change the working directory.
62+
63+
On the *Environment* tab you define optional environment variables.
64+
65+
image:cbs_launch_config_tab_main.png[Launch configuration main tab]
66+
67+
icon:arrow-circle-right[] xref:cbs_debug_project.adoc[Next: Debugging a project]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
////
2+
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation
3+
This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
https://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
////
10+
11+
// pull in shared headers, footers, etc
12+
:docinfo: shared
13+
14+
// support image rendering and table of contents within GitHub
15+
ifdef::env-github[]
16+
:imagesdir: ../../images
17+
:toc:
18+
:toc-placement!:
19+
endif::[]
20+
21+
// enable support for button, menu and keyboard macros
22+
:experimental:
23+
24+
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency,
25+
// this is checked by the build in do_generate_asciidoc.sh, which also ensures
26+
// that the checked in html is up to date.
27+
// do_generate_asciidoc.sh can also be used to apply this header to all the
28+
// adoc files.
29+
// ENDOFHEADER
30+
31+
== Using existing code
32+
33+
This tutorial describes how to create a new Core Build System
34+
(CBS) project for use with existing code.
35+
36+
Using existing code is done by creating a new **empty** CDT project in
37+
the top directory containing the existing source files. CDT project
38+
files will be created in the existing source directory.
39+
40+
=== Using an existing CMake project
41+
42+
To create an empty CMake project in CDT select the template *Empty or Existing CMake
43+
Project* in the *New C/{cpp} Project* wizard.
44+
45+
image:cbs_empty_cmake_project.png[Empty or Existing CMake Project]
46+
47+
In the *New CMake Project* wizard uncheck *Use default location*
48+
and set the location of the existing code.
49+
50+
image:cbs_existing_code_cmake.png[Existing code CMake]
51+
52+
More information about creating a CMake project is described in
53+
xref:new_cmake_proj.adoc[Creating a CMake project]
54+
55+
=== Using an existing Makefile project
56+
57+
Create a CBS Makefile project in CDT as described in
58+
xref:new_cbs_makefile_proj.adoc[Creating a Core Build System Makefile project]
59+
with the following changes:
60+
61+
In the *New Makefile Project* wizard uncheck *Use default location*,
62+
set the location of the existing code, and uncheck *Create Hello
63+
World Source and Makefile example*.
64+
65+
image:cbs_existing_code_makefile.png[Existing code Makefile]
66+
67+
icon:arrow-circle-right[] xref:cbs_launchbar.adoc[Next: Launch Bar]

doc/org.eclipse.cdt.doc.user/src/getting_started/cdt_o_tutorial.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Development Toolkit (CDT) to:
3636
* xref:cdt_w_prepare_workbench.adoc[Prepare the Workbench]
3737
* xref:cdt_w_basic.adoc[Create a simple application]
3838
* xref:new_cmake_proj.adoc[Creating a CMake project]
39-
* xref:cdt_w_newproj.adoc[Create a Makefile project]
39+
* xref:cdt_w_basic.adoc[Create a Managed Build System Makefile project]
4040
* xref:cdt_w_import.adoc[Import an existing project]
4141
* xref:cdt_w_newcpp.adoc[Create a {cpp} file]
4242
* xref:cdt_w_newmake.adoc[Create a makefile]

0 commit comments

Comments
 (0)