# Installation procedure ## Prerequesites - We start by cloning the repository: ```bash # First, we need to clone the repository (here a https remote is used): $> git clone https://gitlab.xlim.fr/haiku/haiku.git --recurse-submodules # If you forgot the --recurse-submodules, you just have to move into the folder and type the following $> cd haiku/ $> git submodule update --init --recursive ``` - A **C99** and **C++17** capable compiler, like MSVC (Visual Studio 2022+), GCC or Clang. - **CMake** : to generate the build system. You can install it using `apt` on Linux, `brew` on Mac or the [download page](https://cmake.org/download/) on Windows. - **On Linux** : If you are not using the headless build, haiku will require the GLFW library ## Compilation Using the command line interface, you can build the project on all platforms using the following commands: ```bash # First, we need to create a build folder: $> mkdir build/ $> cd build/ # Then, we need to configure the project. $> cmake .. ``` ```bash # You'll probably need to specify where glfw is installed. # - using glfw install target: usually in /lib/cmake/glfw3 # - using vcpkg install : usually in /installed//share/glfw3 $> cmake .. -D glfw3_DIR:PATH=[path to gflw3Config.cmake] ``` ```bash # Then we can build the project: $> cmake --build . --config [Debug or Release] # On linux you'll probably need to define the CMAKE_BUILD_TYPE variable instead of config $> cmake -D CMAKE_BUILD_TYPE:String=["Debug" or "Release"] .. $> cmake --build . ``` The main CMakeLists.txt provides several options: - `HAIKU_BUILD_HEADLESS` (default: `OFF`) to compile **haiku** without the application module (headless graphics/compute). - `HAIKU_BUILD_DOCS` (default: `OFF`) to enable/disable the documentation cmake targets. - `HAIKU_BUILD_INSTALL` (default: `ON`) to enable/disable the installation cmake target. ## Installation target If you want to install the library in a custom location, you have to set the `CMAKE_INSTALL_PREFIX` during cmake configuration to tell where the target will be deployed: ```bash # In the build directory, we need to configure the project with the HAIKU_BUILD_INSTALL option $> cmake .. -D CMAKE_INSTALL_PREFIX:PATH= # Now we can build the project: $> cmake --build . --target install ```