xentara-cpp-control v1.0.1
The Xentara C++ Control Framework
Loading...
Searching...
No Matches
Setting Up a Xentara Build Environment

Overview

In this tutorial, we will explore three methods to set up a build environment for Xentara:

  1. Using a pre-built Docker container for a streamlined setup.
  2. Setting up on Debian Linux for advanced users.
  3. Setting up on Windows.

The objectives of this tutorial are to:

  • Provide instructions for setting up a Xentara build environment using Docker.
  • Outline installation steps for a native Debian environment for experienced Linux users.
  • Describe the Windows installation process.

Method 1: Using a Pre-Built Docker Container

Using a pre-built Docker container is the simplest and most consistent way to set up a Xentara build environment.
The official Xentara Docker container is available on Docker Hub and includes all necessary dependencies and configurations.

Steps

  1. Install Docker:
    If you do not have Docker installed, follow the installation instructions at Docker website.
  2. Download and Run the Container:
    Use the official Xentara build environment Docker container by running the following command:

    docker pull xentara/xentara-build
  3. Add the .devcontainer.json File:
    • To simplify setup with Visual Studio Code, Xentara provides a pre-configured .devcontainer.json file on its Docker Hub page.
    • Download the .devcontainer.json file and place it in the root directory of your project.
    • The file will configure Visual Studio Code to automatically use the Xentara Docker container as the development environment.
      Example .devcontainer.json content:

      {
      "name": "Xentara",
      "image": "xentara/xentara-build",
      "customizations": {
      "vscode": {
      "extensions": [
      "ms-vscode.cmake-tools",
      "llvm-vs-code-extensions.vscode-clangd",
      "ms-vscode.cpptools",
      "ms-vscode.cpptools-extension-pack",
      "xaver.clang-format",
      "netcorext.uuid-generator"
      ]
      }
      }
      }

  4. Open in Visual Studio Code:
    Visual Studio Code provides seamless Docker integration. Install the Docker extension for Visual Studio Code, then:
    • Open Visual Studio Code.
    • If the .devcontainer.json file is present, Visual Studio Code will automatically prompt you to reopen your project in the container.
    • Select Reopen in Container to start the Xentara Docker environment.
  5. Select the Target Platform:
    Once you are in the container environment, you need to select the target platform. In Visual Studio Code:
    • Open the Command Palette (by pressing Ctrl+Shift+P or F1).
    • Search for and select CMake: Set Default Target.
    • Choose the target platform (e.g., Clang (amd64) or another specific target as needed for your project).
  6. Start Building:
    With the container running and the target platform selected, you can start building and testing your Xentara project directly within Visual Studio Code.

Method 2: Setting Up on Debian Linux

For advanced users, you can set up a build environment directly on Debian Linux. This method requires a Debian Bookworm environment and a basic understanding of Linux package management and system configurations.

Requirements

  • OS: Debian Bookworm
  • Packages: CMake, Ninja, GCC
  • Xentara Plugin: xentara-cpp-control package

Steps

  1. Update and Upgrade: Start by updating your package lists and upgrading existing packages:

    sudo apt update
    sudo apt upgrade
  2. Install CMake: Install the default CMake version available on Debian Bookworm (typically version 3.25).

    sudo apt install cmake
  3. Install Ninja Build System: Install Ninja, a fast and lightweight build system that Xentara recommends for efficiency.

    sudo apt install ninja-build
  4. Install GCC: Ensure you have GCC installed for C++ support.

    sudo apt install gcc g++
  5. Download and Install xentara-cpp-control:
    • Go to download.xentara.io and use the installer script to download the xentara-cpp-control package.
    • Follow the installation instructions provided on the website to install this package, which provides the necessary libraries and dependencies to build Xentara controls.
  6. Verify the Installation: Check that all packages are installed correctly by running:

    cmake --version
    ninja --version
    gcc --version
Note
This setup is recommended only for experienced users who are comfortable with Linux package management and dependency configurations.

Method 3: Setting Up on Windows

For Windows users, Xentara provides a installer that simplifies the setup process. This method is suitable for building Xentara projects natively on Windows.

Steps

  1. Install the Xentara Installer:
    • Download the Xentara installer from download.xentara.io.
    • Run the installer and follow the on-screen instructions to install the base Xentara platform.
  2. Install the XentaraCPPControl Plugin:
    • Download the XentaraCPPControl installer from download.xentara.io.
    • Run the installer and ensure you select the option to install Development Files during the installation process. These files are necessary for building custom Xentara controls.
Note
This setup supports native Windows compilation only. If you require cross-compilation (e.g., building for Linux targets), you will need to install and configure Windows Subsystem for Linux (WSL). For more details, refer to the Microsoft WSL documentation.

Summary

In this tutorial, we covered three different methods to set up a Xentara build environment:

  1. Docker Container: An easy and portable option using a pre-configured container, ideal for Visual Studio Code users.
  2. Debian Linux Setup: A flexible method on Debian Bookworm for advanced Linux users.
  3. Windows Installation: A installation process for Windows users.

Choose the setup method that best suits your platform and experience level. Each option provides a stable build environment for developing and testing Xentara projects.