|
| 1 | +# 📥Installation Guide |
| 2 | + |
| 3 | +## <img width="28px" src="https://vcpkg.io/assets/mark/mark.svg" /> Using vcpkg |
| 4 | +**Note**: Support vcpkg for package management |
| 5 | +1. Install [vcpkg](https://github.com/microsoft/vcpkg) |
| 6 | +2. Run the following command to install the orange-math package: |
| 7 | +``` |
| 8 | +vcpkg install orange-math |
| 9 | +``` |
| 10 | +CMakeLists.txt |
| 11 | +```cmake |
| 12 | +find_package(omath CONFIG REQUIRED) |
| 13 | +target_link_libraries(main PRIVATE omath::omath) |
| 14 | +``` |
| 15 | +For detailed commands on installing different versions and more information, please refer to Microsoft's [official instructions](https://learn.microsoft.com/en-us/vcpkg/get_started/overview). |
| 16 | + |
| 17 | +## <img width="28px" src="https://upload.wikimedia.org/wikipedia/commons/e/ef/CMake_logo.svg?" /> Build from source using CMake |
| 18 | +1. **Preparation** |
| 19 | + |
| 20 | + Install needed tools: cmake, clang, git, msvc (windows only). |
| 21 | + |
| 22 | + 1. **Linux:** |
| 23 | + ```bash |
| 24 | + sudo pacman -Sy cmake ninja clang git |
| 25 | + ``` |
| 26 | + 2. **MacOS:** |
| 27 | + ```bash |
| 28 | + brew install llvm git cmake ninja |
| 29 | + ``` |
| 30 | + 3. **Windows:** |
| 31 | + |
| 32 | + Install Visual Studio from [here](https://visualstudio.microsoft.com/downloads/) and Git from [here](https://git-scm.com/downloads). |
| 33 | + |
| 34 | + Use x64 Native Tools shell to execute needed commands down below. |
| 35 | +2. **Clone the repository:** |
| 36 | + ```bash |
| 37 | + git clone https://github.com/orange-cpp/omath.git |
| 38 | + ``` |
| 39 | +3. **Navigate to the project directory:** |
| 40 | + ```bash |
| 41 | + cd omath |
| 42 | + ``` |
| 43 | +4. **Build the project using CMake:** |
| 44 | + ```bash |
| 45 | + cmake --preset windows-release -S . |
| 46 | + cmake --build cmake-build/build/windows-release --target omath -j 6 |
| 47 | + ``` |
| 48 | + Use **\<platform\>-\<build configuration\>** preset to build siutable version for yourself. Like **windows-release** or **linux-release**. |
| 49 | + |
| 50 | + | Platform Name | Build Config | |
| 51 | + |---------------|---------------| |
| 52 | + | windows | release/debug | |
| 53 | + | linux | release/debug | |
| 54 | + | darwin | release/debug | |
0 commit comments