Skip to content

Development

Andreas Nicolai edited this page Dec 7, 2018 · 12 revisions

Development information

Writing Code

I highly recommend to use the Qt Creator IDE for developing the code. It is much faster than Visual Studio, runs cross platform (you do not have to change IDE when switching platforms), has much better code navigation ("find uses", "go to definition") and a much more robust code analysis than VC. Also, it is free for open-source development.

In order to create code that matches the coding-guidelines, please setup Qt Creator as described in Qt Creator Editor Settings.

See the following documents for guidelines/settings to use:

Git config

This is a cross-platform project, so line-ending settings should be set correctly: on Windows checkout CRLF, but commit unix-style LF.

When working on Windows

You can set this via the command line:

git config --global core.autocrlf true

Or when using SmartGit edit repository/user git config and specify:

[pull]
    rebase = true
[core]
    autocrlf = true

When working on Linux/Mac

git config --global core.autocrlf input

Building via command line

Building the solver is automated via command line scripts:

On Linux/Mac:

cd build/cmake
# build with 4 CPUs in release mode
./build.sh 4 release

On Windows:

cd build/cmake
:: build with 4 CPUs in release mode
build.bat 4 release

Deployment

OpenHAM is just a single command line executable, statically built against dependend libraries. All you need to do is copy the executable.

On Windows you may need to copy the following DLLs alongside the executable, unless already installed on the target machine (via VC redistributable or similar).

When building with VC 2015:

  • msvcp140.dll
  • vcruntime140.dll

When building with GCC:

  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • libwinpthread-1.dll

QtCreator Configuration

Using Qt Creator for development is recommended. To ensure consistency in source code, please use the following settings to configure your editor.

General Coding Style Settings

Edit the project's coding style, clone the preset and set:

  • Text editor -> Behavior:

     Use Spaces instead of Tabs = off
     Tab width = 4
     Clean whitespaces = Entire Document
    
  • Text editor -> Display (try to keep lines within this limit):

      Show right margin = 120 chars
    

Default Naming Conventions for new Files

  1. Open the menu and go to Options/Preferences.
  2. Open and select the C++ conventions.
  3. Remove the lower case option for filenames and save your configuration by clicking Apply/OK.
Clone this wiki locally