Torque3D
  • General
    • Welcome!
    • Features
    • Release Notes
      • Version 4.0.3
      • Version 4.0.2
      • Version 4.0.1
      • Version 4.0
      • Version 3.10.1
      • Version 3.10
      • Version 3.9
      • Version 3.8
      • Version 3.7
      • Version 3.6.2
      • Version 3.6.1
      • Version 3.6
  • Getting Started
    • Introduction
      • What's the Torque3D Engine?
    • Getting Familiar
      • Getting a Copy
        • Torque Project Manager
        • Downloading it Yourself
      • Getting Ready for Launch
        • Running Pre-Built Binaries
        • Building the Engine Yourself
      • Launching the Game
        • Opening the Example Level
        • Launching the Editors
      • Your First Game
        • Introduction To The Engine
        • The Module System
        • Creating an empty gamemode
        • Adding a Player
        • Adding a Coin
        • Adding a win-condition
        • Custom coin asset
        • Counting coins
        • Adding some effects
        • Supporting multiplayer
        • Adding a Scoreboard GUI
        • Keeping the scoreboard up-to-date
      • Deep Dive: BaseGame Directory Structure
    • Best Practices
    • Porting a Legacy Project
  • For Artists
    • Assets
      • What are Assets?
      • How to Create a New Asset
      • Working With Assets
      • Deep Dive: Creating a New Asset Type
    • Art
      • File Formats
      • 3D Art
        • Shape Specifications
        • Coordinates System
        • Mounting Shapes
        • Animation
        • Player Setup
        • Blender -> Torque3D Pipeline
      • 2D Art
        • Working with Adobe Substance
    • Animation
    • GUI
      • Loading and Initializing a GUI
      • Expanding a GUI via Script
      • How to Network GUIs
    • Materials
      • Material Mapping
      • Material Animation
    • Terrain
    • Shaders
    • Lighting
    • Audio
  • For Designers
    • Base Classes
      • SimObject
      • SimGroup
      • SceneObject
      • Scene
      • Datablocks
    • Game Classes
      • Creating an Object
      • Destroying an Object
      • Gameplay Scripting
        • Spawning an Object from Gameplay Code
    • Modules
      • What are Modules?
      • How to Create a New Module?
      • Making a Module do Things
      • Installing Existing Modules
        • Where to Get More Modules
    • Scenes and Levels
      • How to Create a New Level
      • How to Load a Level
        • Deep Dive: Level Loading Scripts
      • How to Edit Levels
        • Opening a Level in the Editor
        • Spawning Objects from the Asset Browser
        • Working with Scenes
        • Using SimGroups
        • Changing a Level's PostEffects
        • Deep Dive: LevelAsset Companion Files
    • Game Modes
      • Creating a New GameMode
      • Making a Level Use Your GameMode
      • Adding Gameplay Code to Your GameMode
    • AI
      • Navmesh
      • Objects
      • Scripting
    • Inputs
      • Inputs and Keybinds
        • ActionMap
        • Bind Functions
        • ActionMap Stack
    • Localization
    • Editors
      • Changing Editor Settings
      • World Editor
        • Scene Editor
        • ConvexShape Editor
        • Terrain Editor
        • Terrain Painter
        • Material Editor
        • Spline-Based Tools
          • Mesh Road Editor
          • River Editor
          • Decal Road Editor
        • Datablock Editor
        • Particle Editor
        • Decal Editor
        • Forest Editor
        • Navmesh Editor
        • Deep Dive: Creating Your Own Editor
        • Shape Editor
      • GUI Editor
        • Interface Details
  • For Programmers
    • Compiling the Engine
      • Setup Development Environment
        • SDK and Library Installation
        • Git
        • Cmake
        • Creating a Fork on Github
      • Create a Project
        • Creating a Project With CMake
        • Creating a Project With the Project Manager
      • Compiling
        • Compiling in Windows
        • Compiling in Linux
        • Compiling in MacOS
      • Building the Project Manager
    • Introduction
    • Code Style Guidelines
    • Expanding the Engine
      • Creating a New Object Class
      • Exposing Object Classes to Script
        • addProtectedField
      • Adding a New Library to the Engine
    • Major Components of the Engine
      • Core
        • Console
        • Platform
      • Audio
        • SFX
      • Rendering
        • GFX
        • Render Bins
      • Physics
        • Stock T3D Physics
        • Physics Wrapper
          • PhysX
          • Bullet
        • Classes
    • Rendering
    • Math
    • Networking
      • Client and Server Commands
    • Physics
    • Collision
    • Scripting
      • TorqueScript
        • What is TorqueScript?
        • Basic Syntax
        • Variables
        • Types
        • Operators
        • Control Structures
        • Functions
        • Objects
        • Module Interop
          • QueueExec
          • RegisterDatablock
          • CallOnModules
          • ModuleExec
        • API Reference
      • Other Languages
        • C-Interface
    • File Inputs/Outputs(I/O)
    • API Reference
Powered by GitBook
On this page
  • Open CMake GUI
  • Set the Source and Build Directories
  • Configure the Project
  • Build the Project
Edit on GitHub
Export as PDF
  1. For Programmers
  2. Compiling the Engine
  3. Create a Project

Creating a Project With CMake

PreviousCreate a ProjectNextCreating a Project With the Project Manager

Last updated 2 years ago

To create a new project using Torque3D, you can use CMake's GUI application to configure and generate a project file. In this article, we will guide you through the process of setting up and generating a new project in Torque3D using CMake.

Open CMake GUI

After installing CMake and cloning the Torque3D repository, you can open the CMake GUI application. This application allows you to configure and generate a project file for Torque3D.

Set the Source and Build Directories

In the CMake GUI, you need to set the source and build directories. The source directory is the location of the Torque3D repository on your computer, and the build directory is where CMake will generate the project files. To set the directories, click the "Browse Source" and "Browse Build" buttons and select the appropriate folders.

Configure the Project

Once you have set the source and build directories, you can start the configuration process for the project by clicking the "Generate" button. This will bring up a dialog box where you can select the options you want to use for your project

In most cases, the only thing you'll want to worry about at this step is making sure the correct generator is used. This is the program used to ultimately build the project, such as make, Visual Studio, XCode, etc.

Once you've got it selected, click "Finish".

It will do some work, and then throw an "error"

Not to worry! All this means is you need to fill in the TORQUE_APP_NAME field before it can continue.

This will be your project name and will set some internal stuff in the engine, as well as define the application/executable name.

Once you've filled in the name, click "Generate" again and this time it'll run through the whole setup process. Once finished, you should see a lot of options listed in that center window area.

In this configuration box, you can select the build type (Debug or Release), or other options such as whether to enable physics or audio. You can also specify the location of any third-party libraries that you want to use with your project.

While the default configuration will work perfectly out of the box, some common optional settings that may be important ones for your project would be:

  • TORQUE_PHYSX: If on, will enable the use of nVidia's PhysX physics library

  • TORQUE_BULLET: If on, will enable the use of the Bullet physics library

  • TORQUE_NET_CURL: An advanced setting, if enabled, will compile the engine with libCurl support, allowing your game to access web content.

  • TORQUE_D3D11: If enabled, will have the engine support the DirectX 3D 11 rendering API (Only available on Windows)

  • TORQUE_OPENGL: If enabled, will have the engine support the OpenGL rendering API

  • TORQUE_SQLITE: If on, enables support for SQLite databases

When you're happy with the configuration, click the "Generate" button to generate the project files.

Build the Project

Once the project files have been generated, you can build the project by opening the build directory in your preferred development environment and compiling the code.

Depending on availability, you may be able to simply click the "Open Project" button and have the OS open the project file in your preferred IDE automatically.

You can quickly jump to your OS of choice to follow the compilation instructions here:

Compiling in Windows
Compiling in MacOS
Compiling in Linux