Building ozz-animation Static Library for Ubuntu (GCC, CMake & Ninja) Сборка статической библиотеки ozz-animation для Ubuntu (GCC, CMake и Ninja)
A guide to compiling ozz-animation source code into static libraries on Ubuntu using CMake and GCC. Руководство по компиляции исходного кода ozz-animation в статические библиотеки в Ubuntu с помощью CMake и GCC.
Step 1: Install Build Dependencies Шаг 1: Установка зависимостей сборки
Before compiling ozz-animation, ensure that essential build tools like CMake, GCC/G++, Ninja, and wget are installed on your system: Перед сборкой ozz-animation убедитесь, что основные инструменты сборки, такие как CMake, GCC/G++, Ninja и wget, установлены в вашей системе:
sudo apt update && sudo apt install -y \
build-essential cmake ninja-build wget
Step 2: Download ozz-animation Source Code Archive Шаг 2: Скачивание архива исходного кода ozz-animation
Download the source code archive for the desired release tag directly from GitHub Releases: Скачайте архив с исходным кодом для нужного релиза напрямую из GitHub Releases:
Download ozz-animation Releases Скачать релизы ozz-animation
cd ~
wget https://github.com/guillaumeblanc/ozz-animation/archive/refs/tags/0.17.0.tar.gz -O ozz-animation-0.17.0.tar.gz
tar -xzf ozz-animation-0.17.0.tar.gz
cd ozz-animation-0.17.0
Step 3: Create the Build Script Шаг 3: Создание скрипта сборки
In the root directory of the extracted ozz-animation source folder, create a script named build-ubuntu-static.sh with the following content:
В корневой директории извлеченного исходного кода ozz-animation создайте файл build-ubuntu-static.sh со следующим содержимым:
#!/usr/bin/env bash
set -e
BUILD_DIR="build-ubuntu-static"
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Clean old CMake cache if it exists
rm -f CMakeCache.txt
rm -rf CMakeFiles
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$HOME/libs/ozz-animation-0.17.0-ubuntu" \
-DBUILD_SHARED_LIBS=OFF \
-Dozz_build_tools=ON \
-Dozz_build_samples=OFF \
-Dozz_build_tests=OFF \
-Dozz_build_howtos=OFF
cmake --build . --config Release --parallel $(nproc) --target install
CMAKE_INSTALL_PREFIX path to point to your preferred target installation folder.
Убедитесь, что путь CMAKE_INSTALL_PREFIX указывает на удобную для вас директорию установки.
Step 4: Run, Compile, and Clean Up Шаг 4: Запуск, сборка и очистка
Grant execution permissions to the script and run it in your terminal: Сделайте скрипт исполняемым и запустите его в терминале:
chmod +x build-ubuntu-static.sh
./build-ubuntu-static.sh
Upon completion, your static libraries along with header files and tools will be installed in your specified CMAKE_INSTALL_PREFIX directory.
После успешного завершения собранные статические библиотеки, заголовочные файлы и утилиты будут установлены по пути, указанному в CMAKE_INSTALL_PREFIX.
Once installed, you can safely remove the temporary source directory and the downloaded archive: После установки вы можете безопасно удалить временную директорию с исходным кодом и скачанный архив:
cd ~ && rm -rf ~/ozz-animation-0.17.0 ~/ozz-animation-0.17.0.tar.gz
Step 4: Next Steps Шаг 4: Следующие шаги
Now that you have compiled and installed the ozz-animation static libraries, you can integrate them into your C++ projects using CMake: Теперь, когда вы собрали и установили статические библиотеки ozz-animation, вы можете интегрировать их в свои C++ проекты с помощью CMake:
Support My Work Поддержать проект
If these tutorials helped you, consider buying me a coffee! Если эти туториалы вам помогли, вы можете поддержать автора.
Sberbank (Russia only) Сбербанк (только для РФ)
Direct transfer via phone number (Russia only) Перевод по номеру телефона (только для РФ)
USDT TRC20
Support via Cryptocurrency Поддержка криптовалютой