-
Notifications
You must be signed in to change notification settings - Fork 215
Getting Started documentation update. #1056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+30.6 KB
doc/org.eclipse.cdt.doc.user/images/c_cpp_project_wizard_cmake_properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.6 KB
doc/org.eclipse.cdt.doc.user/images/c_cpp_project_wizard_makefile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.1 KB
doc/org.eclipse.cdt.doc.user/images/c_cpp_project_wizard_makefile_properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 116 additions & 0 deletions
116
doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_build_project.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
//// | ||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation | ||
This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
SPDX-License-Identifier: EPL-2.0 | ||
//// | ||
|
||
// pull in shared headers, footers, etc | ||
:docinfo: shared | ||
|
||
// support image rendering and table of contents within GitHub | ||
ifdef::env-github[] | ||
:imagesdir: ../../images | ||
:toc: | ||
:toc-placement!: | ||
endif::[] | ||
|
||
// enable support for button, menu and keyboard macros | ||
:experimental: | ||
|
||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, | ||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures | ||
// that the checked in html is up to date. | ||
// do_generate_asciidoc.sh can also be used to apply this header to all the | ||
// adoc files. | ||
// ENDOFHEADER | ||
|
||
== Building a project | ||
|
||
During Core Build System (CBS) project creation a launch configuration | ||
with the same name is created along with it. The Build settings are | ||
managed in the *Build Settings* tab of the launch configuration. | ||
|
||
CBS projects rely on the xref:cbs_launchbar.adoc[Launch Bar]. Make | ||
sure the launch bar is installed and enabled. | ||
|
||
=== Building for Run | ||
|
||
. Select the launch configurion of the project you want to build. | ||
. Select launch mode *Run*. | ||
. Press the *Build* button in the launch bar. | ||
. Inspect the build output in the Console window. | ||
. Find the build results in the Project Explorer. | ||
|
||
image:cbs_build.png[Build a project for Run] | ||
|
||
=== Building for Debug | ||
|
||
To build for Debug: | ||
|
||
. Select the launch configurion of the project you want to build. | ||
. Select launch mode *Debug*. | ||
. Press the *Build* button. | ||
. Inspect the build output in the Console window. | ||
. Find the build results in the Project Explorer. | ||
|
||
image:cbs_build_debug.png[Build a project for Debug] | ||
|
||
=== Changing build settings | ||
|
||
The launch configuration presents separate build settings for launch mode | ||
Run and Debug. You will see the build settings depending on the selected | ||
launch mode. | ||
|
||
To change Run build settings: | ||
|
||
. Set the launch mode to *Run* | ||
. Edit the project's launch configuration. Click on the gear icon. | ||
|
||
image:cbs_edit_launch_config_run.png[Edit launch configuration] | ||
|
||
The edit launch configuration wizard will open. Select the *Build | ||
Settings* tab. | ||
|
||
The only settings that can be changed are the build chain, and how | ||
CMake or Make is called. There are no options to set pre-processor | ||
symbols or include paths. This makes that the project can easily be | ||
shared with other IDEs, command line, or continuous integration flows. | ||
|
||
The following picture shows the build settings of a CMake project. | ||
|
||
image:cbs_build_settings_tab_cmake.png[CMake build settings tab] | ||
|
||
=== Makefile projects BUILD_MODE | ||
|
||
For CBS Makefile projects the launch mode is passed to `make` via | ||
environment variable `BUILD_MODE`. In the Makefile you can make use of | ||
this variable to set the wanted `CFLAGS` per launch mode. | ||
|
||
[cols="1,1"] | ||
|=== | ||
|Launch mode | BUILD_MODE | ||
|
||
|Run | ||
|run | ||
|
||
|Debug | ||
|debug | ||
|=== | ||
|
||
Here is some example code that makes use of `BUILD_MODE` to set the | ||
wanted `CFLAGS`: | ||
|
||
[source,makefile] | ||
---- | ||
ifeq ($(BUILD_MODE),debug) | ||
CFLAGS += -g -O0 | ||
else ifeq ($(BUILD_MODE),run) | ||
CFLAGS += -O2 | ||
endif | ||
---- | ||
|
||
icon:arrow-circle-right[] xref:cbs_run_project.adoc[Next: Running a project] |
81 changes: 81 additions & 0 deletions
81
doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_debug_project.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
//// | ||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation | ||
This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
SPDX-License-Identifier: EPL-2.0 | ||
//// | ||
|
||
// pull in shared headers, footers, etc | ||
:docinfo: shared | ||
|
||
// support image rendering and table of contents within GitHub | ||
ifdef::env-github[] | ||
:imagesdir: ../../images | ||
:toc: | ||
:toc-placement!: | ||
endif::[] | ||
|
||
// enable support for button, menu and keyboard macros | ||
:experimental: | ||
|
||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, | ||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures | ||
// that the checked in html is up to date. | ||
// do_generate_asciidoc.sh can also be used to apply this header to all the | ||
// adoc files. | ||
// ENDOFHEADER | ||
|
||
== Debugging a project | ||
|
||
Debugging a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make | ||
sure the launch bar is installed and enabled. | ||
|
||
First build the project for Debug. | ||
See xref:cbs_build_project.adoc[Building a project]. | ||
|
||
. Select the launch configuration of the project you want to run. | ||
. Select launch mode *Debug*. | ||
. Press the *Debug* button in the launch bar. | ||
. Confirm the switch to the Debug Perspective. | ||
|
||
image:cbs_debug_cmake.png[Launch a CMake project for Debug] | ||
|
||
The Perspective will change to *Debug*, and you can start debugging. | ||
|
||
image:cbs_debugging.png[Debugging a CMake project] | ||
|
||
|
||
=== Changing debug settings | ||
|
||
To change debug settings: | ||
|
||
. Set the launch mode to *Debug* | ||
. Edit the project's launch configuration. Click on the gear icon. | ||
|
||
image:cbs_edit_launch_config_debug.png[Edit launch configuration] | ||
|
||
The edit launch configuration wizard will open. Notice that there are | ||
now two extra tabs *Debugger* and *Source*, because the launch mode is | ||
*Debug*. These are not present in launch mode *Run*. | ||
|
||
On the *Main* tab you can set an alternative C/C++ application, and | ||
you can enable or disable build before launch. | ||
|
||
On the *Arguments* tab you specify optional arguments, and you can | ||
change the working directory. | ||
|
||
On the *Environment* tab you define optional environment variables. | ||
|
||
On the *Debugger* tab you can set an alternative debugger. If the | ||
debugger name is not an absolute path, CDT will look first for the | ||
debugger in the selected toolchain in the *Build Settings* tab. When | ||
it is not found in the toolchain the debugger is searched in the | ||
*PATH* environment variable defined locations. | ||
|
||
On the *Source* tab extra paths outside the project folder can be | ||
defined to look for source code. | ||
|
||
image:cbs_launch_config_tab_debug.png[Launch configuration debug tab] |
55 changes: 55 additions & 0 deletions
55
doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_launchbar.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//// | ||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation | ||
This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
SPDX-License-Identifier: EPL-2.0 | ||
//// | ||
|
||
// pull in shared headers, footers, etc | ||
:docinfo: shared | ||
|
||
// support image rendering and table of contents within GitHub | ||
ifdef::env-github[] | ||
:imagesdir: ../../images | ||
:toc: | ||
:toc-placement!: | ||
endif::[] | ||
|
||
// enable support for button, menu and keyboard macros | ||
:experimental: | ||
|
||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, | ||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures | ||
// that the checked in html is up to date. | ||
// do_generate_asciidoc.sh can also be used to apply this header to all the | ||
// adoc files. | ||
// ENDOFHEADER | ||
|
||
== Launch Bar | ||
|
||
Core Build System (CBS) projects rely on the *Launch Bar*. Make sure | ||
the _LaunchBar UI_ feature is installed and enabled. In the global | ||
preferences the launch bar can be enabled or disabled. | ||
|
||
image:launchbar_preferences.png[Launch Bar preferences] | ||
|
||
The launch bar exists out of several components: | ||
|
||
image:launchbar.png[Launch Bar] | ||
|
||
. Build button, to launch a build. | ||
. Run button, to launch a run. This button will change to a Debug | ||
button in Debug mode. | ||
. Stop button, to stop a Run or Debug session. | ||
. Launch mode selector. To change between Run and Debug mode. | ||
. Launch configuration selector. | ||
. Edit launch configuration. To change the launch configuration | ||
properties. | ||
. Target selector. Not always visible. | ||
. Edit target. | ||
|
||
icon:arrow-circle-right[] xref:cbs_build_project.adoc[Next: Building a | ||
project] |
67 changes: 67 additions & 0 deletions
67
doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_run_project.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//// | ||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation | ||
This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
SPDX-License-Identifier: EPL-2.0 | ||
//// | ||
|
||
// pull in shared headers, footers, etc | ||
:docinfo: shared | ||
|
||
// support image rendering and table of contents within GitHub | ||
ifdef::env-github[] | ||
:imagesdir: ../../images | ||
:toc: | ||
:toc-placement!: | ||
endif::[] | ||
|
||
// enable support for button, menu and keyboard macros | ||
:experimental: | ||
|
||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, | ||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures | ||
// that the checked in html is up to date. | ||
// do_generate_asciidoc.sh can also be used to apply this header to all the | ||
// adoc files. | ||
// ENDOFHEADER | ||
|
||
== Running a project | ||
|
||
Running a CBS project is done via the xref:cbs_launchbar.adoc[Launch Bar]. Make | ||
sure the launch bar is installed and enabled. | ||
|
||
First build the project for Run. | ||
See xref:cbs_build_project.adoc[Building a project]. | ||
|
||
. Select the launch configuration of the project you want to run. | ||
. Select launch mode *Run*. | ||
. Press the *Run* button in the launch bar. | ||
. Inspect the program output in the Console window. | ||
|
||
image:cbs_run_cmake.png[Launch a CMake project for Run] | ||
|
||
=== Changing run settings | ||
|
||
To change run settings: | ||
|
||
. Set the launch mode to *Run* | ||
. Edit the project's launch configuration. Click on the gear icon. | ||
|
||
image:cbs_edit_launch_config_run.png[Edit launch configuration] | ||
|
||
The edit launch configuration wizard will open. | ||
|
||
On the *Main* tab you can set an alternative C/C++ application, and | ||
you can enable or disable build before launch. | ||
|
||
On the *Arguments* tab you specify optional arguments, and you can | ||
change the working directory. | ||
|
||
On the *Environment* tab you define optional environment variables. | ||
|
||
image:cbs_launch_config_tab_main.png[Launch configuration main tab] | ||
|
||
icon:arrow-circle-right[] xref:cbs_debug_project.adoc[Next: Debugging a project] |
67 changes: 67 additions & 0 deletions
67
doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_using_existing_code.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//// | ||
Copyright (c) 2000, 2025 Contributors to the Eclipse Foundation | ||
This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License 2.0 | ||
which accompanies this distribution, and is available at | ||
https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
SPDX-License-Identifier: EPL-2.0 | ||
//// | ||
|
||
// pull in shared headers, footers, etc | ||
:docinfo: shared | ||
|
||
// support image rendering and table of contents within GitHub | ||
ifdef::env-github[] | ||
:imagesdir: ../../images | ||
:toc: | ||
:toc-placement!: | ||
endif::[] | ||
|
||
// enable support for button, menu and keyboard macros | ||
:experimental: | ||
|
||
// Until ENDOFHEADER the content must match adoc-headers.txt for consistency, | ||
// this is checked by the build in do_generate_asciidoc.sh, which also ensures | ||
// that the checked in html is up to date. | ||
// do_generate_asciidoc.sh can also be used to apply this header to all the | ||
// adoc files. | ||
// ENDOFHEADER | ||
|
||
== Using existing code | ||
|
||
This tutorial describes how to create a new Core Build System | ||
(CBS) project for use with existing code. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It assumes existing code is located in a directory containing source files. Note, CDT project files are written into this directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
|
||
Using existing code is done by creating a new **empty** CDT project in | ||
the top directory containing the existing source files. CDT project | ||
files will be created in the existing source directory. | ||
|
||
=== Using an existing CMake project | ||
|
||
To create an empty CMake project in CDT select the template *Empty or Existing CMake | ||
Project* in the *New C/{cpp} Project* wizard. | ||
|
||
image:cbs_empty_cmake_project.png[Empty or Existing CMake Project] | ||
|
||
In the *New CMake Project* wizard uncheck *Use default location* | ||
and set the location of the existing code. | ||
|
||
image:cbs_existing_code_cmake.png[Existing code CMake] | ||
|
||
More information about creating a CMake project is described in | ||
xref:new_cmake_proj.adoc[Creating a CMake project] | ||
|
||
=== Using an existing Makefile project | ||
|
||
Create a CBS Makefile project in CDT as described in | ||
xref:new_cbs_makefile_proj.adoc[Creating a Core Build System Makefile project] | ||
with the following changes: | ||
|
||
In the *New Makefile Project* wizard uncheck *Use default location*, | ||
set the location of the existing code, and uncheck *Create Hello | ||
World Source and Makefile example*. | ||
|
||
image:cbs_existing_code_makefile.png[Existing code Makefile] | ||
|
||
icon:arrow-circle-right[] xref:cbs_launchbar.adoc[Next: Launch Bar] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.