1# Build / Install Instructions
2
3## Install on all platforms using vcpkg
4You can download and install assimp using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
5```bash
6    git clone https://github.com/Microsoft/vcpkg.git
7    cd vcpkg
8    ./bootstrap-vcpkg.sh
9    ./vcpkg integrate install
10    vcpkg install assimp
11```
12The assimp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
13
14## Install on Ubuntu
15You can install the Asset-Importer-Lib via apt:
16```
17sudo apt-get install assimp
18```
19
20## Install pyassimp
21You need to have pip installed:
22```
23pip install pyassimp
24```
25
26## Manual build instructions
27
28### Install CMake
29Asset-Importer-Lib can be build for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via
30```bash
31sudo apt-get install cmake
32```
33
34### Get the source
35Make sure you have a working git-installation. Open a command prompt and clone the Asset-Importer-Lib via:
36```bash
37git clone https://github.com/assimp/assimp.git
38```
39### Build from source:
40```bash
41cd assimp
42cmake CMakeLists.txt
43cmake --build .
44```
45
46### Build instructions for Windows with Visual-Studio
47
48First you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/
49To generate the build environment for your IDE open a command prompt, navigate to your repo and type:
50```bash
51cmake CMakeLists.txt
52```
53This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it.
54
55### Build instructions for Windows with UWP
56See <https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app>
57
58### Build instructions for Linux / Unix
59Open a terminal and got to your repository. You can generate the makefiles and build the library via:
60
61```bash
62cmake CMakeLists.txt
63make -j4
64```
65The option -j descripes the number of parallel processes for the build. In this case make will try to use 4 cores for the build.
66
67If you want to use a IDE for linux you can try QTCreator for instance.
68
69### Build instructions for MinGW
70 Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag
71required to compile some of assimp's files, especially for debug builds.
72Version 7.3.0 of g++-mingw-w64 & gcc-mingw-w64 appears to work.
73
74Please see [CMake Cross Compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling) for general information on CMake Toolchains.
75
76Some users have had success building assimp using MinGW on Linux using [polly](https://github.com/ruslo/polly/).
77
78The following toolchain, which is not maintained by assimp, seems to work on Linux: [linux-mingw-w64-gnuxx11.cmake](https://github.com/ruslo/polly/blob/master/linux-mingw-w64-gnuxx11.cmake)
79
80The following toolchain may or may not be helpful for building assimp using MinGW on Windows (untested):
81 [mingw-cxx17.cmake](https://github.com/ruslo/polly/blob/master/mingw-cxx17.cmake)
82
83Besides the toolchain, compilation should be the same as for Linux / Unix.
84
85### CMake build options
86The cmake-build-environment provides options to configure the build. The following options can be used:
87- **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib.
88- **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle
89- **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values.
90- **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets
91- **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active
92- **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality
93- **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib
94- **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library.
95- **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut).
96- **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library.
97- **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage.
98- **ASSIMP_ERROR_MAX( default OFF)**: Enable all warnings.
99- **ASSIMP_WERROR( default OFF )**: Treat warnings as errors.
100- **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer.
101- **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer.
102- **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library.
103- **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen.
104- **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names
105- **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash.
106- **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files.
107