Note: Support vcpkg for package management
- Install vcpkg
- Run the following command to install the orange-math package:
vcpkg install orange-math
CMakeLists.txt
find_package(omath CONFIG REQUIRED)
target_link_libraries(main PRIVATE omath::omath)For detailed commands on installing different versions and more information, please refer to Microsoft's official instructions.
Note: Support xrepo for package management
- Install xmake
- Run the following command to install the omath package:
xrepo install omath
xmake.lua
add_requires("omath")
target("...")
add_packages("omath")Note: Support Conan for package management
- Install Conan
- Run the following command to install the omath package:
conan install --requires="omath/[*]" --build=missing
conanfile.txt
[requires]
omath/[*]
[generators]
CMakeDeps
CMakeToolchainCMakeLists.txt
find_package(omath CONFIG REQUIRED)
target_link_libraries(main PRIVATE omath::omath)For more details, see the Conan documentation.
Note: This is the fastest option if you don’t want to build from source.
-
Go to the Releases page
- Open the project’s GitHub Releases page and choose the latest version.
-
Download the correct asset for your platform
- Pick the archive that matches your OS and architecture (for example: Windows x64 / Linux x64 / macOS arm64).
-
Extract the archive
- You should end up with something like:
include/(headers)lib/orbin/(library files / DLLs)- sometimes
cmake/(CMake package config)
- You should end up with something like:
-
Use it in your project
If the extracted folder contains something like
lib/cmake/omathorcmake/omath, you can point CMake to it:# Example: set this to the extracted prebuilt folder list(APPEND CMAKE_PREFIX_PATH "path/to/omath-prebuilt") find_package(omath CONFIG REQUIRED) target_link_libraries(main PRIVATE omath::omath)
If there’s no CMake package config, link it manually:
target_include_directories(main PRIVATE "path/to/omath-prebuilt/include") # Choose ONE depending on what you downloaded: # - Static library: .lib / .a # - Shared library: .dll + .lib import (Windows), .so (Linux), .dylib (macOS) target_link_directories(main PRIVATE "path/to/omath-prebuilt/lib") target_link_libraries(main PRIVATE omath) # or the actual library filename
-
Preparation
Install needed tools: cmake, clang, git, msvc (windows only).
-
Clone the repository:
git clone https://github.com/orange-cpp/omath.git
-
Navigate to the project directory:
cd omath -
Build the project using CMake:
cmake --preset windows-release -S . cmake --build cmake-build/build/windows-release --target omath -j 6Use <platform>-<build configuration> preset to build suitable version for yourself. Like windows-release or linux-release.
Platform Name Build Config windows release/debug linux release/debug darwin release/debug