Difference between revisions of "Automatic source paths"

From Code::Blocks
Line 16: Line 16:
 
Adding or Editing a path opens the ''Edit path dialog''
 
Adding or Editing a path opens the ''Edit path dialog''
 
[[File:Globs ui 2.png|thumb|alt=|center]]
 
[[File:Globs ui 2.png|thumb|alt=|center]]
1) The path to automatically overwatch
+
# The path to automatically overwatch
2) Open the system path dialog to select the path to automatically overwatch
+
# Open the system path dialog to select the path to automatically overwatch
3) Open the global variables dialog to select a global variable that is replaced and overwatched by codeblocks
+
# Open the global variables dialog to select a global variable that is replaced and overwatched by codeblocks
4) If this is checked all sub folder of this path are also overwatched
+
# If this is checked all sub folder of this path are also overwatched
5) A list of wildchards separated by ';' for file extension that are imported for this glob (ex. ''*.h'' to import only header files, ''*.cpp;*.h'' to import cpp and h files
+
# A list of wildchards separated by ';' for file extension that are imported for this glob (ex. ''*.h'' to import only header files, ''*.cpp;*.h'' to import cpp and h files
  
 
== Example ==
 
== Example ==
 +
In this example we use the following folder structure:
 +
[[File:Directory 1.png|thumb|center]]
 +
Lets assume that files in ''src'' are added/removed automatically by a third party software. Adding now an ''automatic source folder'' in codeblocks will automatically add/remove files if they are changed on the file system.
 +
[[File:Edit glob example.png|thumb|center]]
 +
[[File:Edit glob example 2.png|thumb|center]]

Revision as of 20:30, 11 February 2023

Introduction

Automatic source paths is a feature of codeblocks to automatically mirror folders from the source directory to the codeblocks project file. A use case is for example if a external program creates source files that are used in codeblocks. With automatic source paths codeblocks automatically detects changes (addition and removal of source files) in the given directory and mirrors them to the project file.

UI

The functionality can be accessed over the Project->Automatic source folders menu entry:

Globs menu.png

This opens the overview dialog

Globs ui 1.png
  • Path: The base path in which files are searched for automatic import
  • Recursive: Search also in sub folders
  • Wildcard: Filter files according this wildcard (for example *.cpp: import only files ending with .cpp
  • Add: Add an new path
  • Delete: Delete current selected path from the list
  • Edit: Edit current selected path from the list

Adding or Editing a path opens the Edit path dialog

  1. The path to automatically overwatch
  2. Open the system path dialog to select the path to automatically overwatch
  3. Open the global variables dialog to select a global variable that is replaced and overwatched by codeblocks
  4. If this is checked all sub folder of this path are also overwatched
  5. A list of wildchards separated by ';' for file extension that are imported for this glob (ex. *.h to import only header files, *.cpp;*.h to import cpp and h files

Example

In this example we use the following folder structure:

Directory 1.png

Lets assume that files in src are added/removed automatically by a third party software. Adding now an automatic source folder in codeblocks will automatically add/remove files if they are changed on the file system.

Edit glob example.png
Edit glob example 2.png