fred.akilla Posted May 16, 2020 Posted May 16, 2020 (edited) This post provides informations on the steps for creating a C++ project with UNIGINE and using QtCreator as IDE on Linux platform. We suppose that QtCreator and Unigine SDK are already installed as well as GCC compiler and CMake. QtCreator is a cross-platform IDE so same process can be achieved on Windows using the VS compiler or GCC for Windows. my current system : LinuxMint 19.0 GCC 7.4.0 CMake 3.10.2 (note that CMake 3.14 or higher is required by default but I can get it work with 3.10, see below) Qt SDK 5.11.2 Unigine 2 Community : SDK 2.11.01 1. Run Unigine SDK browser an create a new project Set a project name : my_unigine_project Select API + IDE : C++ (CMake) And click "Create New Project" 2. Customize code editor On Unigine browser, click "..." button under "Open Code IDE" Editor : Custom Binary : /opt/Qt5.11.2/Tools/QtCreator/bin/qtcreator (path where QtCreator is installed on your system) Argument : CMakeLists.txt And click Open (it will open QtCreator) 3. Configure QtCreator Select Desktop GCC 64 bits kit and click "Configure Project" 4. Edit CMake file (optionnal) This step is only required if you have a CMake version lower than 3.14, because you will get this error: Just change the first line : cmake_minimum_required(VERSION 3.14) with cmake_minimum_required(VERSION 3.10) Save and go to Menu / Compile / Run CMake C++ Project is now loaded. 5. Setup Build and Run project Go to Projects / Build and Run Select Build panel and select your build configuration (Debug/Release/..) In order to run Unigine project from QtCreator you need to edit Run parameters with Unigine arguments. Select Run Panel and set the "Command line arguments" : -data_path ../ -engine_config unigine.cfg -console_command "world_load \"my_unigine_project\"" See Unigine documentation for command line informations. 6. Run project You can now edit and compile your code as usual in QtCreator. Run your project by clicking the big green triangle in QtCreator or Ctrl+r shortcut. Great. Thanks Unigine. Edited May 16, 2020 by fred.akilla 8
Recommended Posts