2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Clang-format
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								We use clang-format to maintain a consistent formating of the code. Since there are small differences between different version of clang-format we use version 8 on all platforms.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:58:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								On **Ubuntu 18.04**  run the following commands to install clang-format-8
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								sudo sh -c 'echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-8 main" > /etc/apt/sources.list.d/llvm8.list'
							 
						 
					
						
							
								
									
										
										
										
											2019-05-17 15:50:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								sudo apt-get update
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								sudo apt-get install clang-format-8
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:58:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								On **MacOS**  [Homebrew ](https://brew.sh/ ) should install the right version of clang-format:
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								brew install clang-format
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Install and configure QtCreator
  
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:58:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Download and install QtCreator. On **Ubuntu 18.04**  run:
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								wget https://download.qt.io/official_releases/qtcreator/4.9/4.9.0/qt-creator-opensource-linux-x86_64-4.9.0.run
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								chmod +x qt-creator-opensource-linux-x86_64-4.9.0.run
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								./qt-creator-opensource-linux-x86_64-4.9.0.run
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:58:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								On **MacOS**  run:
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2019-05-17 15:50:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								brew cask install qt-creator
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								After installation, go to `Help`  -> `About plugins...`  in the menu and enable Beautifier plugin (formats the code automatically on save):
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Go to `Tools`  -> `Options`  and select the Beautifier tab. There select ClangFormat as the tool in `General`  tab.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:58:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Select file as predefined style in `Clang Format`  tab. Also select `None`  as the fallback style. For **Ubuntu 18.04**  change the executable name to `/usr/bin/clang-format-8` .
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Build project
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								First, clone the project repository.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								git clone --recursive https://gitlab.com/VladyslavUsenko/basalt.git
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								After that, in QtCreator open to the `CMakeLists.txt`  in the `basalt`  folder and configure the project with `Release with Debug Info`  configuration. The build directory should point to `/<your_installation_path>/basalt/build` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:56:58 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-05-15 11:28:35 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Finally, you should be able to build and run the project.