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.


FieldDescriptionCommentsMacro
Project TypeSets the output type of the project. Can be one of the following: Exe, static library or shared libraryWhen changing the type from dll/exe to static library, the link stage is skipped.None
CompilerThe compiler associated to the project. The compiler list can be modified via 'Build->Advance Settings...' menuNoneNone
DebuggerThe debugger that will be invoked when debugging the projectThe list of the debugger depends on the installed debugger extensionsNone
Output FileThe project output file nameNone$(OutputFile)
IntermediateDirectoryThis path is used by CodeLite to store all intermediate files (object files, dependency files etc.)None$(IntermediateDirectory) or $(OutDir)
CommandThe command to be executed when running the program (either with or without the debugger)NoneNone
Command ArgumentsProgram arguments to be passed to the executed commandNoneNone
Working DirectorySets the working directory of the executed programNoneNone

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



FieldDescriptioncommentsMacro
Compiler OptionsA (semi-colon separated) list of options to be passed to the compiler during compilation of every source file in the projectSince 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 PathA list of additional paths separated by semi-colons, to be passed to the compiler for locating include filesTo include paths with space, surround them with double quotation marks$(IncludePath)
PreprocessorA list of macros separated by semi-colons, to be passed to the compilerNone$(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



FieldDescriptioncommentsMacro
OptionsA (semi-colon separated) list of options to be passed to the linker during linkSince CodeLite uses a makefile based system, you can pass complex expressions like $(shell wx-config --libs)$(LinkOptions)
Library PathA list of additional paths separated by semi-colons, to be passed to the linker for locating libraries/shared objectsIf a path contains white-space, surround it with double-quotes e.g. "/path/with a/space"$(LibPath)
LibrariesA list of libraries separated by semi-colons, to be passed to the linkerCodeLite 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 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



FieldDescriptioncommentsMacro
OptionsA (semi-colon separated) list of options to be passed to the resource compilerSince CodeLite uses a makefile based system, you can pass complex expressions like $(shell wx-config --rcflags)$(RcCmpOptions)
Additional Search PathA (semi-colon separated) list of paths (relative or absolute) to be passed to the resource compilerIf 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.

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.

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.



Home



Blix theme adapted by David Gilbert, powered by PmWiki