Skip to main content

History: Setting Up An Application - QtCreator - Linux

Source of version: 6 (current)

Copy to clipboard
            {DIV(class="Layout_box6")}{SPLIT(colsize=15%|85%)}{img fileId="1919"}---
{DIV(class="bigBold")}Setting Up An Application With QtCreator - Linux{DIV}{SPLIT}
{DIV}
%clear%
!Introduction
This set of instructions will walk you through setting up a QtCreator C++ project from scratch.

When you have finished this tutorial you will be able to compile a working Ogre Application and you will be ready to start the ((Basic Tutorials)).

{maketoc}

!Prerequisites
Follow the instruction at ((Building Your Projects With CMake)) to setup a CMake project.
Do not generate the project using the CMake GUI - you don't need to as QtCreator will handle the rest.

!Setting up an Ogre project in QtCreator
!!Open project
QtCreator - File - Open File or Project:
{img fileId="1950" width="400" thumb="y" alt="" rel="box[g]"}
!!Choose build location
{img fileId="1949" width="400" thumb="y" alt="" rel="box[g]"}
!!Run CMake
{img fileId="1951" width="400" thumb="y" alt="" rel="box[g]"}
!!Make in console
You need to find the qtcreator-build directory and run this in a console:
{CODE(wrap="1", colors="bash")}make && make install{CODE}
The reason is that it's a bit involved to set up an INSTALL build configuration in QtCreator, and it only needs to be done once.
!!Setup executable for project run
Now, click the green arrow in the sidebar to build and run the project.
Since we haven't set up any run configuration, we are prompted to do that in the following dialogue:
{img fileId="1952" width="400" thumb="y" alt="" rel="box[g]"}
Choose {MONO()}build_directory/dist/bin/OgreApp{MONO} as executable and {MONO()}build_directory/dist/bin{MONO} as working directory.
!!Rejoice
{img fileId="1953" width="400" thumb="y" alt="" rel="box[g]"}
!Conclusion
As you can see, it's rather easy to setup a project in QtCreator if you use a CMake script.
QtCreator doesn't touch your source directory, except one file: {MONO()}CMakeLists.txt.user{MONO}.