Skip to content

Project Setup

Dandielo edited this page Feb 3, 2023 · 12 revisions

Overview

The recipe makes use of the deploy functionality of Conan which will copy all required files into your workspace.

This is achieved using the conan install command with an explicit package reference. In the default case the reference would be ice-build-tools/<version>@iceshard/stable. Additional arguments can be provided, like -if which tells the command where to install the given package.

Installation and overview

First, check which version of IBT (starting from 1.0.2) you want to install and run one the following commands:

# Run this command in your projects folder
conan install ice-build-tools/1.0.2@iceshard/stable

# ... or this command if you want to install IBT in a different location
conan install ice-build-tools/1.0.2@iceshard/stable -if path/to/project

After it successfully installs the IBT you will find a few new files and folders.

  • The main script which is ibt.bat or ibt.sh depending on the OS you are using.
  • The workspace.moon script which describes your basic setup.
  • The tools directory which will contain the most basic conanfile.txt.
  • The deploy_manifest.txt which contains the summary of deployed files and can be removed.

The 'ibt.*' shell scripts

These scripts ensure and wrap access to the packages referenced in 'tools/conanfile.txt' and access the command line tools from a virtual environment.

Please see application and commands for more details.

The 'workspace.moon'

Please see workspace for more details.

The 'tools/conanfile.txt'

This file is used to control the installed version of IBT and additional tools that should be updated separately from your project's direct dependencies. In most cases this will not change often.

Project templates (stable since v1.2.0)

Using the template option allows you to select a pre-configured workspace setup providing an even quicker way to start new projects.

NOTE: Using multiple templates in the same directory is not supported.

By default, the package comes with three different simple templates, which populate the directory with a sample project and all required files to build it.

Available templates are:

  • consoleapp - Prints 'Hello, World!' to the console.
  • dynamiclib - Builds a shared library.
  • staticlib - Builds a static binary.

Additional templates can be defined in any git repository that can be accessed via an URL. To do so provide the location to the repository using the template_repo option. You can also provide a short form {user}/{repo} value is it's hosted on GitHub.

The commands below show how to install a specific project template of your choosing:

# Installation without an argument will set up most crucial files but is insufficient to build anything.
conan install ice-build-tools/x.y.z@iceshard/stable

# Selecting a template will prepare the workspace with additional files allowing a simpler start.
conan install ice-build-tools/x.y.z@iceshard/stable -o"template=consoleapp"
conan install ice-build-tools/x.y.z@iceshard/stable -o"template=staticlib" -if path/to/project

# Example on how to access custom templates from other repositories.
#   Note: If the repository is hosted on GitHub you can use the short form to point to it. (ex.: user/repository)
conan install ice-build-tools/x.y.z@iceshard/stable -o"template=multiplatform" -o"template_repo=user/repository"