SolidOpt Build System

SolidOpt Framework is almost entirely using cmake as a build system. This has several advantages:

  • Gives us more control over the entire build process.
  • Allows "templetizing" the source files where possible: For example, we extract out the common parts from AssemblyInfo.cs for each assembly and let cmake substitute the necessary information in order to adapt it to the concrete assembly.
  • Prevents "svn bloats" in case of in-source builds: Usually the sln and csprojs are next to the source files. The project files don't have a specification and thus the IDE is allowed to change their content. For example, MonoDevelop capitalizes the GUIDs and turns "false" into "False". If one wants, for example, to commit a very simple change he/she has to deal with filtering out all the implicit changes (which make no sense), done by the IDE. Even worse, if one needs to add a file, some of the changes to the project file are relevant. In such case one has to open a text editor and remove the irrelevant changes by hand. This worsen the workflow and makes the development a nightmare.
  • Generates sln and csprojs on demand: Our build system can generate project files on demand and they are put in the out-of-source build folder.
  • It gives us a platform-independent handle to control the build process from the terminal: This makes developers/users that prefer the terminal happy. More importantly, this simplifies using continuous integration tools, such as CTest and CDash.

Using The Build System

In order to use the build system you will need to install cmake. After downloading the source files (see quickstart), we need to configure the build by running:

Terminal

cd builddir
cmake sourcedir

where "builddir" is the folder where the build system will put the binary files and "sourcedir" is the source code of the project.

    There are number of configuration flags that could be passed to the cmake invocation.
  • VS10SLN - Enables the generation of project files.
  • CMAKE_BUILD_TYPE - Enables debug or release builds.
  • CSHARP_FRAMEWORK_VERSION - Changes the framework version ("1.1", "2.0", "3.5", "4.0").
  • CSHARP_SDK_COMPILER - Changes the default SDK version ("/sdk:4", "/sdk:2")

For example enabling generation of project files is done by passing:

cmake sourcedir -DVS10SLN=1

Building the project can be done by running:

make

for the Unix-based operating systems. There are different targets which could be built separately. Every library or binary in SolidOpt has its own target. For example, if one needs to build only SolidOpt.Services.dll, all he has to do is to run make and specify the target name as an argument:

make SolidOpt.Services

and it will be built along with its dependencies.

Along with libraries and executables there are some other targets which the build system can build. Such target is our doxygen based documentation. One can build his/hers own local copy of the online documentation by running:

make doxygen

It requires doxygen generation tool to be preinstalled.

On windows it can be done either by nmake or see section IDE.

IDE

Alternatively, you could use cmake-gui, which is a cmake tool with graphical user interface, which helps with configuration. Point to the right source and build folder, enable VS10SLN parameter and click configure. Open the generated SolidOpt.sln in your build folder with your favourite IDE.

Running Tests

SolidOpt test suite is based on NUnit.

make test

will run all the tests in SolidOpt. Alternatively, this could be done from the IDE.