General


In this document, I will go over the project settings tabs and will explain how each entry affects the generated makefile.

The project settings


The project settings is available via right click on the project name and selecting 'Settings', the projects' settings dialog pops up and set to the 'General' tab (the first tree item)

General Page


The general page contains various information regarding which compiler to use, debugger to be associated with the project.

The lower part of the page - splitted by a gray divider 'Action' - contains information used by LiteEditor 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 LiteEditor to store all intermediate files (object files, dependencie files etc.)None$(IntermediateDirectory) or $(OutDir)
CommandThe command to be executed when running the program without debugger or under the debuggerNoneNone
Command ArgumentsProgram arguments to be passed to the executed commandNoneNone
Working DirectorySets the working directory of the executed programNoneNone

Table 1: General Page

Compile Page


This page contains all the information required by LiteEditor during the compile stage, such as:

  • Compiler various flags (-g, -O etc)
  • Preprocessors (-D)
  • Additional search path for include files
FieldDescriptioncommentsMacro
Compiler OptionsA semi colons list of options to be passed to the compiler during compilation of every source file in the projectSince LiteEditor uses a makefile based system, you can pass complex expressions like $(shell wx-config --cflags)$(CmpOptions) note that this marco also includes the value set in the $(Preprocessors) macro
Additional Search PathA list of additional paths separated by semi colon 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 colon to be passed to the compilerNone$(Preprocessor)

Table 2: Compiler Page

Linker Page


This page contains all the information required by LiteEditor during the Link stage, such as:

  • Linker various flags (-OX, -fPIC etc)
  • Libraries needed for link
  • Additional search path for libraries
FieldDescriptioncommentsMacro
OptionsA semi colons list of options to be passed to the linker during linkSince LiteEditor 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 colon to be passed to the linker for locating libraries/shared objectsTo include paths with space, surround them with double quotation marks$(LibPath)
LibrariesA list of libraries separated by semi colon to be passed to the linkerLiteEditor removes any trailing '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

Resource Page


Currently, LiteEditor recognizes .rc files as resource file which will be passed to the resource compiler (if enabled, by default it is disabled)

This page contains information to be passed to the resource compiler during build:

  • Compiler options
  • Additional search path
FieldDescriptioncommentsMacro
OptionsA semi colons list of options to be passed to the resource compilerSince LiteEditor uses a makefile based system, you can pass complex expressions like $(shell wx-config --rcflags)$(RcCmpOptions)
Additional Search PathA semi colons list of paths (relative or absolute) to be passed to the resource compilerTo include paths with space, surround them with double quotation marks$(RcIncludePath)

Pre Build


On this page, user 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 start (in a case where you have

Each command can be enabled/disabled.

An example for command:

 wxrc /c /v /o resources.cpp resources.xrc

Post Build


On this page, user can define a collection of shell commands to be executed after the link is ended (successfully).

Each command can be enabled/disabled.

An example for commands:

 cp *.a  ../../lib/
 cp *.h  ../../include/

Custom Build


There are cases , usually a legacy projects or an existing projects which depends on an existing build system, where user would like to use its current build system and not on the auto-generated makefile by LiteEditor. This can be done by enabling the 'Enable Custom Build' checkbox on this page.

When enabled, user can set two commands that will be executed for the build & clean process.
It is important to understand that LiteEditor uses makefile as its underlying build system, so even these commands are executed via a makefile and are not passed directly to the shell.
Also, you must rememeber that the working directory is set to project working directory and not the workspace.

However, there are advantages when using the makefile as the mediator to the shell, for example, to execute a multiple steps in a single command:

 qmake && make

The above command will run 'qmake' followed by 'make' command.

Currently, when the custom build is enabled, all other pages are ignored

Custom Makefile Rules


This page contains an area to insert a user makefile rule to be executed during the pre build stage (actually, it will be before the command inserted inside the 'Pre Build' page).

You must be familiar with makefile writing conventions to use this page.

This page allows user to add custom steps as pre-build steps, but unlike the command provided in the Pre Build page, this step can contain conditions.
For example, lets assume we have a project with yacc & flex files that needs to be generated before compilation, we could place five simple rules inside the 'Pre Build' page that will do 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

the problem with the above rules are that they will be executed every time we hit the build button, which results in constant rebuilds...

The solution is to add an advance makefile rule:
In the dependencies line, we make out rule to be dependent on the generated files by placing them in the dependencies line:

 parser.cpp lexer.h

And in the rule's body, we add two rules to generate them:

 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

 lexer.cpp: lexer.l
     @echo Generating lexer.cpp ...
     flex -L  lexer.l
     mv lex.yy.c lexer.cpp

The 'parser.cpp' rule will be executed only if grammar.y was modifed, and lexer.cpp rule will be executed only if lexer.l was modified.

Edit - History - Print - Recent Changes - Search
Page last modified on November 29, 2013, at 02:25 PM