How to alter the setting of a Project is described discursively in Project Settings. Here, that information is repeated more concisely, in a form easier to use as a reference.
The General Page
The general page contains various bits of information regarding which compiler to use, the debugger to be associated with the project etc.
The lower part of the page - split by the gray divider labelled 'Action' - contains settings used by CodeLite when executing the build target or when debugging the target.
Field | Description | Comments | Macro |
Project Type | Sets the output type of the project. Can be one of the following: Exe, static library or shared library | When changing the type from dll/exe to static library, the link stage is skipped. | None |
Compiler | The compiler associated to the project. The compiler list can be modified via 'Build->Advance Settings...' menu | None | None |
Debugger | The debugger that will be invoked when debugging the project | The list of the debugger depends on the installed debugger extensions | None |
Output File | The project output file name | None | $(OutputFile) |
Intermediate Folder | This path is used by CodeLite to store all intermediate files (object files, dependency files etc.) | None | $(IntermediateDirectory) or $(OutDir) |
Program | The command to be executed when running the program (either with or without the debugger) | None | None |
Working Folder | sets the working directory for the debuggee / program to run | None | None |
Program Arguments | Program arguments to be passed to the executed command | None | None |
Debug arguments | If 'Use separate debug arguments' is checked, this field contains program arguments to be passed to the debuggee, if left unchecked the 'Program Arguments' are used by the debuggee as well | None | None |
Table 1: General Page
The Compile Page
This page contains all the information required by CodeLite during the compile stage, such as:
- Compiler various flags (-g, -O etc)
- Preprocessors (-D)
- Additional search paths for include files
Field | Description | comments | Macro |
Use with global settings | A three option choice box that instructs codelite how to merge between the 'Global Settings' and the settings set in this page | None | None |
Compiler Options | A (semi-colon separated) list of options to be passed to the compiler during compilation of every source file in the project | Since CodeLite uses a makefile based system, you can pass complex expressions like $(shell wx-config --cflags) | $(CmpOptions) note that this macro also includes the value set in the $(Preprocessors) macro |
Additional Search Path | A list of additional paths separated by semi-colons, to be passed to the compiler for locating include files | To include paths with space, surround them with double quotation marks | $(IncludePath) |
Preprocessor | A list of macros separated by semi-colons, to be passed to the compiler | None | $(Preprocessor) |
Table 2: Compiler Page
The Linker Page
This page contains all the information required by CodeLite during the Link stage, such as:
- Linker various flags (-OX, -fPIC etc)
- Libraries needed for link
- Additional search path for libraries
Field | Description | comments | Macro |
Use with global settings | A three option choice box that instructs codelite how to merge between the 'Global Settings' and the settings set in this page | None | None |
Options | A (semi-colon separated) list of options to be passed to the linker during link | Since CodeLite uses a makefile based system, you can pass complex expressions like $(shell wx-config --libs) | $(LinkOptions) |
Library Path | A list of additional paths separated by semi-colons, to be passed to the linker for locating libraries/shared objects | If a path contains white-space, surround it with double-quotes e.g. "/path/with a/space" | $(LibPath) |
Libraries | A list of libraries separated by semi-colons, to be passed to the linker | CodeLite removes any 'lib' prefix from the library name and it also removes the extension (.so, .dll, .a, .lib etc) e.g. Assuming using the default GNU g++ compiler, the following library name: libMyLibrary.1.a is converted into -lMyLibrary | $(Libs) |
Table 3: Linker Page
The Environment Page
This page contains information for codelite regarding which environment sets to apply for this workspace
Field | Description | comments | Macro |
Environment variable set to use | Select the environment variables to apply for this workspace | Environment variables are managed from the menu: Settings | Environment variables... | None |
Debugger 'PreDefined Types' set to use | Select the debgger pre-defined types to use for this workspace | Debugger pre-defined types are managed from the menu: Settings | Debugger Settings ... | PreDefined types | None |
The Debugger Page
This page contains project specific information about the debugger (which overrides the global settings of the debugger)
Field | Description | comments | Macro |
Debugger path | Select the debugger executable to use for this project | If left empty, codelite will use the debugger executable set from Settings | Debugger Settings... | None |
Host / tty | Set the IP / Hostname hosting the gdbserver | None | None |
Port | Set the port on which gdbserver is listening (not required when using 'tty') | None | None |
The Resource Page
Currently, CodeLite recognizes .rc files as resource file which will be passed to the resource compiler (if enabled; by default it's disabled)
This page contains information to be passed to the resource compiler during build:
- Compiler options
- Additional search path
Field | Description | comments | Macro |
Use with global settings | A three option choice box that instructs codelite how to merge between the 'Global Settings' and the settings set in this page | None | None |
Options | A (semi-colon separated) list of options to be passed to the resource compiler | Since CodeLite uses a makefile based system, you can pass complex expressions like $(shell wx-config --rcflags) | $(RcCmpOptions) |
Additional Search Path | A (semi-colon separated) list of paths (relative or absolute) to be passed to the resource compiler | If a path contains white-space, surround it with double-quotes e.g. "/path/with a/space" | $(RcIncludePath) |
The Pre Build Page
On this page, you can define a collection of shell commands to be executed before the compilation starts. This is useful for cases when a certain pre-processor stage should be applied to file(s) before the actual build process starts.
Each command can be enabled/disabled by placing a pound sign in front of it ('#')
An example command:
wxrc /c /v /o resources.cpp resources.xrc
The Post Build Page
On this page, you can define a collection of shell commands to be executed after the link is ended (successfully).
Each command can be enabled/disabled by placing a pound sign in front of it ('#')
Example commands:
cp *.a ../../lib/
cp *.h ../../include/
The Custom Build Page
There are cases, usually a legacy project or an existing project which depends on an particular build system, where a user would like to use a pre-existing build system instead of a makefile auto-generated by CodeLite. The next tab, 'Custom Build', allows this; and is described here.
Custom Makefile Steps
This page allows user to specify makefile rule(s) to be executed during the pre-build stage (actually, it will be executed before the commands provided in the 'Pre Build' page).
You must be familiar with makefile writing conventions to use this page.
The main different between the commands executed in the Pre-Build stage and the commands that will be executed in this rule, is that the commands in the Pre-Build stage are executed unconditionally, while rules set here are executed based on their dependencies.
For example, lets assume that we have a project with a yacc & flex files that needs to be preprocessed by the Yacc & Flex tools before compilation to generate the appropriate .cpp/h files. Now, we could place the following five rules inside the 'Pre Build' page that performs the work:
yacc -dl -t -v grammar.y
mv y.tab.c parser.cpp
mv y.tab.h lexer.h
flex -L lexer.l
mv lex.yy.c lexer.cpp
However, the problem with the above rules, is that they are executed every time we hit the build button, which results in constant rebuilds...
To workaround this 'constant rebuilds' we add an advance makefile rule, instead of the above commands:
In the dependencies line, we set the generated files as the dependencies, for our example, the generated files are parser.cpp and lexer.cpp, so the dependencies line contains:
parser.cpp lexer.cpp
As the rule content we set the following:
## rule to generate parser.cpp based on grammar.y
parser.cpp: grammar.y
@echo Generating parser.cpp and lexer.h ...
yacc -dl -t -v grammar.y
mv y.tab.h lexer.h
mv y.tab.c parser.cpp
## rule to generate lexer.cpp based on lexer.l
lexer.cpp: lexer.l
@echo Generating lexer.cpp ...
flex -L lexer.l
mv lex.yy.c lexer.cpp
The 'parser.cpp' rule is executed only if grammar.y was modified, and lexer.cpp rule is executed only if lexer.l was modified.
The Global Settings Page
This page contains 3 tabs which are identical to the 'Compiler', 'Linker' and 'Resources' pages
The idea is to provide a location where user can provide settings which will affect *all* build configuration thus reduce the typing
and duplicating settings between the different configuration (e.g. Release / Debug)