README.md 6.98 KB
Newer Older
Bastian Krayer's avatar
Bastian Krayer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# General information

This repository contains a basic project setup.

## Adding your own executables

You can add your own executable by creating a folder in *src/executables* and adding your source files. You have to copy the CMakeLists.txt from another executable or write your own. Afterwards rerun cmake. 

## Adding your own libraries

You can add your own library by creating a folder in *src/libraries* and adding your source files. For libraries, all headers should be placed in a folder *libraryname/include/libraryname* and all source files in *libraryname/src* You have to copy the CMakeLists.txt from another library or write your own. Afterwards rerun cmake.

## Dependencies

You can specify dependencies by creating a file *depencies.txt* in your project directory. For examples, check the existing executables and libraries.
Dependencies are transitive, so if you include library A, that depends itself on library B, then your project will depend on library B automatically as well.

# IDEs

## Recommended IDEs

### Visual Studio Code

- https://code.visualstudio.com/ 
- Alternative Build without Microsoft Telemetry: https://github.com/VSCodium/vscodium

### CLion

- (https://www.jetbrains.com/clion/) (register with your ...@uni-koblenz.de address to get a free student license)

## Other IDEs

### Qt Creator

- https://www.qt.io/offline-installers
- Choose Qt Creator on the left side and download the appropriate binary

### Eclipse

- https://www.eclipse.org/downloads/
- Choose the C/C++ Installation
- Recent versions of Eclipse for C++ have been known to not work properly

# Setup

## Quick setup Mac OS X

Needs more testing!

- install dependencies via homebrew or macports (e.g. ```brew install homebrew/versions/glfw3 glm cmake assimp```) 

### Visual Studio Code setup (https://code.visualstudio.com/)

- Install extensions: C/C++ (ms-vscode.cpptools), CMake Tools (ms-vscode.cmake-tools)
- Open the repository's *src* folder in VS Code
- Follow the popup instructions to configure Intellisense
- *Ctrl + p* opens the command bar
  - *CMake: Build* will build the project. You will be asked to select the appropriate compiler. Choose the one corresponding to your installation
  - *CMake: Run without debugging* will run an executable that you can specify with *CMake: Set Debug Target*


### Clion setup

- download and install [Clion IDE](https://www.jetbrains.com/clion/) (register with your ...@uni-koblenz.de address to get a free student license)
- click "Check out from Version Control" and clone the repository (```git@gitlab.uni-koblenz.de:cg/ss21cg3.git``` or ```https://gitlab.uni-koblenz.de/cg/ss21cg3.git```)


### Console setup

- install dependencies via homebrew or macports (e.g. ```brew install homebrew/versions/glfw3 glm```) 
- clone repository to some place (with ```git clone git@gitlab.uni-koblenz.de:cg/ss21cg3.git``` or ```git clone https://gitlab.uni-koblenz.de/cg/ss21cg3.git```)
- prompt in CVK folder and create a build folder: ```mkdir & cd  build```
- run cmake ```cmake ..```
### Qt Creator setup

- Open the *src/CMakeLists.txt* as a project
  
Happy Coding!

---

## Quick setup Windows    

- clone repository to some place
- download the dependencies (https://owncloud.uni-koblenz-landau.de/owncloud/s/AycR2askPsMMsyJ)
- - SetEnvironment.bat sets environment variables: OpenGL_ROOT GLM_ROOT GLFW3_ROOT ASSIMP_ROOT
- **Important**: Supported Compilers are Visual Studio 17/19 and MinGW-w64 (http://mingw-w64.org/doku.php)
  - Recommended compiler: Visual Studio 19 (can be downloaded as Visual Studio Build Tools)
Bastian Krayer's avatar
Bastian Krayer committed
89
90
    - Visual Studio Build Tools can be downloaded here: https://visualstudio.microsoft.com/de/downloads/ 
    - You can get the full IDE or just the build tools. For those, scroll down to "Tools for Visual Studio 2019" and choose "Build Tools for Visual Studio 2019"
Bastian Krayer's avatar
Bastian Krayer committed
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  - Recommended installation for MinGW: MSys2
- Install CMake https://cmake.org/

### Visual Studio Code setup (https://code.visualstudio.com/)

- Install extensions: C/C++ (ms-vscode.cpptools), CMake Tools (ms-vscode.cmake-tools)
- Open the repository's *src* folder in VS Code
- Follow the popup instructions to configure Intellisense
- *Ctrl + p* opens the command bar
  - *CMake: Build* will build the project. You will be asked to select the appropriate compiler. Choose the one corresponding to your installation (e.g. "GCC for x86_64-mingw32 9.2.0" or "Visual Studio Build Tools...")
  - *CMake: Run without debugging* will run an executable that you can specify with *CMake: Set Debug Target*
 
### Clion setup

- download and install [Clion IDE](https://www.jetbrains.com/clion/)  (register with your ...@uni-koblenz.de address to get a free student license)
- Open the file *src/CMakeLists.txt* and choose *Open as Project*


### Qt Creator setup

- Open the *src/CMakeLists.txt* as a project

Happy Coding!

---

##   Quick setup Linux (dependencies for ubuntu)

Tested on Ubuntu 18.04 Should work very similar on different distributions

- use your package-manager to install the dependencies (GLM, GLFW, assimp, Xrandr, Xi)
    Ubuntu: ```sudo apt-get install libglm-dev libglfw3-dev libassimp-dev libxrandr-dev libxi-dev```
- install CMake either from the site (https://cmake.org/) or from your package manager. It is recommended not to use aptitude, as the cmake version is old. 

### Visual Studio Code setup (https://code.visualstudio.com/)

- Install extensions: C/C++ (ms-vscode.cpptools), CMake Tools (ms-vscode.cmake-tools)
- Open the repository's *src* folder in VS Code
- Follow the popup instructions to configure Intellisense
- *Ctrl + p* opens the command bar
  - *CMake: Build* will build the project. You will be asked to select the appropriate compiler. Choose the one corresponding to your installation (e.g. something like "GCC for x86_64")
  - *CMake: Run without debugging* will run an executable that you can specify with *CMake: Set Debug Target*
- _NOTE_: If you have installed cmake with snap, you may have to go to the CMake Tools settings and put the following in CMake Path: */snap/cmake/current/bin/cmake*

### Clion setup

- download and install [Clion IDE](https://www.jetbrains.com/clion/)  (register with your ...@uni-koblenz.de address to get a free student license)
- click "Check out from Version Control" and clone the repository or open the *src/CmakeLists.txt* from your already cloned repository

### Qt Creator setup

- Open the *src/CMakeLists.txt* as a project

Happy Coding!

---

# Troubleshooting

Bastian Krayer's avatar
Bastian Krayer committed
150
If on Git clone you are prompted for a password like git@gitlab.com's password: something is wrong with your SSH setup. You can try to clone the repository with the https link (https://gitlab.uni-koblenz.de/CVK/CVK_2.git)
Bastian Krayer's avatar
Bastian Krayer committed
151
152
153
154
155
156
or you should ...
- ensure that you generated your SSH key pair correctly and added the public SSH key to your GitLab profile
- try manually registering your private SSH key using ssh-agent as documented earlier in this document
- try to debug the connection by running ssh -Tv git@example.com (replacing example.com with your GitLab domain)

More details can be found [here](https://docs.gitlab.com/ce/ssh/README.html).