4.6. Project Configuration
Project configuration involves setting the correct build flags for targets, groups and project itself. You can set these flags in their respective properties dialog.
You can freely use autoconf and automake variables that are automatically set for the project during configuration. Apart from these automatically set variables, you can also defined your own variables in Project Properties use them in properties. This will make it easy to update flags later, especially when the variable is used in several targets.
Some of the many common variables are listed here. For full list of them see automake info documentation.
$(prefix): The installation prefix. The project is installed under various sub-directories under this prefix. By default it is /usr/local.
$(bindir): The installation directory for executable binaries. All your executable and scripts targets would be installed in this directory. By default, it is $(prefix)/bin.
$(libdir): The installation directory for libraries. All your library targets (both shared and static) would be installed in this directory or a subdirectory below it. By default, it is $(prefix)/lib.
$(module_CFLAGS) and $(module_LIBS): These flags are set by configure for the packages that your project depends on. The packages used by the project are set in Project Properties. 'module' is the packages group that you give in project properties.
4.6.1. Project properties
Project properties dialog can be only brought by choosing ->. You can:
Set project name, version and URL in page. Configure variables can also be use in these fields. The URL is the bug report URL for the project.
Add and remove dependencies for your project in page. See below for details.
Create more configure variables in page to use in group and target properties.
Dependencies are external packages that the project uses and hence required to build it. Only packages installed using pkg-config can be added from this interface. For others, the configure.ac file can be edited manually.
External package dependencies are grouped into modules, so that their combined build flags can be conviniently added to different targets. Modules are just arbitrary names given to group the packages and can be named anything (only alphanumeric and _ are allowed in module name). Usually, they follow the name of targets they would be use in. Consequently, for small projects with single targets, just one module to hold all dependencies is enough.
Each package exports a set of compiler flags and libraries. They are aggregated together for all packages under a module and configure variables $(module_CFLAGS) and $(module_LIBS) are defined. These variables can then be used in Group properties and Target properties.
To add a package dependency:
Select -> to bring up project properties dialog.
Select the tab to bring up packages page.
Select the module to add the package to. If there is no module created yet or there is no appropriate module, create one by clicking . Give a sensible name to the module, preferably in UPPERCASE to match with rest of configure variables (only use alphanumeric and '_' characters) and press Enter to create it.
Click to bring up package selection dialog.
Select the package to add and click .
Click to close the properties dialog.
4.6.2. Group properties
To set group properties, select it in the Project View and active it. You can also bring it by selecting ->
Group Properties set to a group applies to all the targets under it. So any compiler or linker flags set there would be automatically be part of all the targets in it (in addition the targets individual properties). Folowing flags are available in group properties.
Includes: Set your $(module_CFLAGS) variables and other include directories for your c and c++ targets. You need to provide the full include options of the compiler here, e.g. -I/usr/include/blah. The include paths will be use to find the include files in your source files. You can also add other sort of compiler flags here, but they are prefered to be set in their respective compiler flags properties (see below).
Usually your configure script would also make some automatically determined compiler flags. The variables usually end with _CFLAGS, e.g $(PACKAGE_CFLAGS). They are also set here. See setting Project properties for more details on these variables.
Compiler settings: Set your compiler specific flags here. There are different fields for different compiler categories. Flags that can be set here depend on the actual compiler used. The default compiler use for c/c++ is gcc/g++ (gnu c compiler). Check out gcc info documentation for more details.
Install directories: Targets in the group that require installation directories would each get a field to enter the installation directory. Set their installation directories as relative to one of the many automake directory variables, such as $(prefix), $(bindir), $(libdir), $(datadir) etc.
4.6.3. Target properties
To set target properties, select it in the Project View and active it. You can also bring it by selecting ->
Target Properties set to a target applies to that target. So any compiler or linker flags set there would be just part of it (in addition the its group properties). Folowing flags are available in target properties.
Compiler settings: Set your compiler specific flags here. There are different fields for different compiler categories. Flags that can be set here depend on the actual compiler used. The default compiler use for c/c++ is gcc/g++ (gnu c compiler). Check out gcc info documentation for more details.
Linker flags: Set linker flags that should be used when linking the target. It applies only to Program and library targets. See ld info documentation for available linker options.
Libraries: Set the libraries that the target depends on. Usually they are the $(module_LIBS) configure variables. See setting Project properties for more details on these variables.
