charon-core
0.3.1
|
This Project uses the CMake Makefile generator to manage the build process for various build tools.
To create the build files, run CMake (at least Version 2.8) on the project root directory and select the desired Makefile generator. More information about this step can be found at the CMake Documentation Website.
You can use in-source or out-of-source-builds. The advantage of in-source-builds is that you have all files (sources and binaries) in the same directories, but this makes it difficult to keep svn ignore lists etc. up to date. Source packages will be messed up too (see below). To keep the source directories clean, you can use out-of-source build which means that you create a second folder where binaries and tempoary files will be stored. It is possible to create multiple build directories where you can use different build systems (MinGW/MSVC/...) or different compiler settings.
If you use the CMake GUI, you have to specify two directories, the source and the build directory. If these are the same, you perform a in-source-build, if you select two different directories, the source directory will be kept clean.
There are different configuration options that can be en- or disables as needed. These switches can be found in the CMake Cache editor (ccmake or cmake-gui). They are visible in the simple view.
pdflatex
.When using the GNU gcc compiler, some compiler flags are are very useful for debugging. The used flags can be modified in the CMake Cache editor. The simplest way is using the CMake GUI. Don't forget to select the advanced or grouped view to be able to change the settings mentioned below.
The recommended flags for CMAKE_CXXFLAGS
and CMAKE_CFLAGS
are:
You can specify a project build type (Debug, Release, ...) using the CMake Cache editor (command-line: ccmake
, graphical: cmake-gui
).
Recommended settings for CMAKE_C(XX)FLAGS_DEBUG
:
Recommended settings for CMAKE_C(XX)FLAGS_RELEASE
:
If you are using Visual Studio, you do not need to tweak any of these settings.
After this configure step, you can build the project with your selected build tool (e.g. by typing mingw32-make
in the console when using "MinGW Makefiles" as Makefile generator). The final executable will be avaiable in the app
Directory. Unit tests are avaiable using the command make test
To install the software, use the install command (the target directory can be changed in the CMake Cache editor). More confortable is the usage of precompiled packages that can be generated using CPack.
If you want to use the <make> install
command, check the following variables in the CMake Cache:
CMAKE_INSTALL_PREFIX
: this is where the project will be installedCMAKE_INSTALL_DOC
: this is where the documentation will be installed (this can be used if you want to install the documentation in a seperate directory) Do not set this to an absolute path or a path outside the build directory (i.e. no path like ../blah) if you want to create packages.