You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+120-4Lines changed: 120 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,136 @@ Initially generated with [xmlpg](https://github.com/open-dis/xmlpg).
7
7
8
8
## Building Open DIS
9
9
10
-
*[premake5](http://premake.github.io/) is required to build the platform specific projects. Download it and make sure it's available on your path, or specify the path to it.
10
+
*[CMake](http://cmake.org/) is required to build the platform specific projects.
11
+
It can be downloaded and installed from http://cmake.org/
11
12
12
-
* SDL2 and SDL2_net are required libraries to compile the examples. See the [.travis.yml](.travis.yml) for more details on setting up a build environment.
13
+
* SDL2 and SDL2_net are required libraries to compile the examples.
14
+
These can usually be install via Linux package managers.
15
+
More details, and instructions for Windows are included [below](#SDL2-and-SDL2_net-Install-Instructions).
13
16
14
-
### Linux
17
+
**NOTE:** Windows users will need to either add the DLL folders to their path, or copy the DLLs to the output directory (`Debug`).
15
18
19
+
### Linux / GNU Makefiles
20
+
21
+
1. Run `mkdir build`
22
+
1. Run `cd build`
23
+
1. Run `cmake ..`
24
+
1. Optionally, `-DCMAKE_INSTALL_PREFIX=<custom-path-to-install>` to set a custom directory to install the bin, include, and lib output directories.
25
+
1. Run `make` - this will output the libOpenDIS6.so, and libOpenDIS7.so libraries in the build directory along with the Example Applications.
26
+
1. The below steps are optional
27
+
1. Run `make package` to build Linux package files. Currently this will produce a Red Hat RPM package, Debian DEB package, and 2 compressed tarball (XZ, GZ).
28
+
1. Run `make install` to install bin, lib, and dir, into `CMAKE_INSTALL_PREFIX`
29
+
WARNING: `CMAKE_INSTALL_PREFIX` default can to somewhere `/usr/local/`, if not specified with the `-D` flag as shown in Step 3.1.
30
+
If you're unsure where to install, and want to keep your `/usr/local/` directory clean, run `cmake .. -DCMAKE_INSTALL_PREFIX=./install`.
31
+
This will cause `make install` to create a local install directory, from which you can move files elsewhere at a later date.
32
+
33
+
#### Windows with Visual Studio
34
+
1. Open `CMake (cmake-gui)` via the the start menu.
35
+
2. Enter the open-dis-cpp directory path into the Source and Build fields.
36
+
3. Click the `+ Add Entry` button and enter the following details:
37
+
Name: `SDL_INC_DIR`
38
+
Type: `PATH`
39
+
Value: `<SDL2-install-folder>/include`
40
+
(if you follow the below [SDL2 Windows Install Instruction](#Windows-Install-Instructions) this will be `C:/SDL2/include`)
41
+
3. Click the `+ Add Entry` button and enter the following details:
42
+
Name: `SDL_LIB_DIR`
43
+
Type: `PATH`
44
+
Value: `<SDL2-install-folder>/lib/x64` (64 bit) or `<SDL2-install-folder>/lib/x86` (32 bit)
45
+
(if you follow the below [SDL2 Windows Install Instruction](#Windows-Install-Instructions) this will be `C:/SDL2/lib/x64`)
46
+
4. Click Configure and follow the prompts, selecting the correct generator (i.e. Visual Studio version).
47
+
5. Click Generate
48
+
6. Click Open Project - This should open the generates solution file in Visual Studio
49
+
7. Build the Solution (`Ctrl + Shift + B`)
50
+
51
+
These steps were tested with Visual Studio 16 2019 (Community Edition).
52
+
Currently, only OpenDIS 6 and the Example Applications compile.
53
+
The library and executable files are output to a `Debug` directory.
54
+
55
+
To run the executables, either the value of the `SDL_LIB_DIR` variable should be added to your path,
56
+
or `SDL2.dll` and `SDL2_net.dll` need to be copied to the `Debug` directory.
57
+
58
+
### Cleaning CMake files
59
+
60
+
To quickly clean up CMake output files, use `git clean -xdf`.
61
+
**Note:** Use with care if you are actually developing open-dis-cpp, as `git clean` removes untracked files.
62
+
63
+
### Old Pre-make build instructions
64
+
65
+
*[premake5](http://premake.github.io/) is required to build the platform specific projects. Download it and make sure it's available on your path, or specify the path to it.
66
+
67
+
#### Linux / GNU Makefiles
16
68
1. Run `premake5 gmake`
17
69
1. Run `make config=release`
18
70
19
-
### Windows
20
71
72
+
#### Windows with Visual Studio 2015
21
73
1. Run `premake5 vs2015`
22
74
1. Open the solution and build.
23
75
24
76
## Developer Docs
25
77
26
78
The latest doxygen docs for the Open DIS master branch can be found [here](https://codedocs.xyz/open-dis/open-dis-cpp/).
If you're unable to install the correct packages, try [installing from source](#POSIX-Source-Installation)
91
+
92
+
### Windows Install Instructions
93
+
94
+
These are the installation steps that have been tested with open-dis-cpp, however there are other methods for installation.
95
+
Experienced users should feel free to customise their install.
96
+
97
+
#### (Core) SDL2 Instructions
98
+
99
+
1. Navigate to the SDL2 [Download](https://www.libsdl.org/download-2.0.php) page, and download the latest Development Libraries.
100
+
101
+
Alternatively, the version tested with open-dis-cpp, 2.0.12-VC, can be downloaded from this [direct link](https://www.libsdl.org/release/SDL2-devel-2.0.12-VC.zip).
102
+
103
+
2. Extract the SDL2-devel-2.0.12-VC.zip file directly to your `C:\`.
104
+
3. Rename the resulting `SDL2-2.0.12` folder to `SDL2`.
105
+
4. Add `C:\SDL2\lib\x64` to your System Path for 64-bit systems,
106
+
or add `C:\SDL2\lib\x86` for 32-bit systems.
107
+
108
+
#### SDL2_net Instructions
109
+
110
+
1. Navigate to the SDL2_net [project](https://www.libsdl.org/projects/SDL_net/) page, and download the latest Development Libraries.
111
+
112
+
Alternatively, the version tested with open-dis-cpp, 2.0.1-VC, can be downloaded from this [direct link](https://www.libsdl.org/projects/SDL_net/release/SDL2_net-devel-2.0.1-VC.zip).
113
+
114
+
2. Extract the SDL2-devel-2.0.12-VC.zip
115
+
3. Copy the `include` and `lib` directories from the resulting folder into you `C:\SDL2\` folder
0 commit comments