CopperSpice Overview  1.5.2
Using Qt Creator

Qt Creator is an integrated development environment which can be used to develop, compile, link, deploy, and run a C++ application using CopperSpice. The UI Designer, which is a component in the IDE, allows developers to drag and drop widgets on a form to create the graphical user interface for an application.

Toolchain Setup

In order to build, a kit must first be created and then configured. The kit contains information about the toolchain and where the compiler, linker, and debugger programs are located. This step applies to building with CMake or Autotools.

To create a kit select "Manage Kits..." from the Projects tab. Click on the Add button to add a new kit. We suggest you call your kit CopperSpice and set it as the default. This kit will be used for every project that is built with the CopperSpice libraries. The following is a list of the the typical parameters.

Adding a Kit (step one)

Key Value
Name CopperSpice
Device Type Desktop
Device Local PC
Compiler C MinGW
Compiler C++ MinGW
Debugger System GDB
Qt version none

If you are using CMake select the "Manage..." button to the right of "CMake Tool". Click on the Add button to add a new CMake entry. We suggest you call this CMake and set it as the default. Select the Browse button to locate the CMake.Exe path.

Use the appropriate "step two" directions depending on which build system is being used.


Project Setup Using CMake (step two)

Create Project

Use the following steps to create the new project. Once the project is configured any existing source or ui files can be copied into the new project.

  • Create a folder where the new project will reside
  • Select File, New File or Project
  • Non-Qt Project
  • Plain C++ Application
  • Enter the Project name and location
  • Select CMake for the build system
  • Select the CopperSpice kit then expand the Details
  • Edit the folder names as needed
  • Select the version control system as needed
  • Finish

Edit Build File

After the project is created a very basic CMakeLists.txt will automatically be generated. This file will need to be modified to link with the CopperSpice libraries. Refer to the following link for information on how to edit the CMake build files: CopperSpice Project Using CMake

Configure CMake

In order to build the project must be configured.

  • From the Projects tab click on the CopperSpice label in the Build and Run section
  • Under the CopperSpice label select Build
  • Modify the Build directory as needed, the directory entered must already exist
  • From the main Build menu select Run CMake

Compile and Run

From the main Build menu select Run.


Project Setup Using Autotools (step two)

Create Project

Use the following steps to create the new project. Once the project is configured any existing source or ui files can be copied into the new project.

  • Create a folder where the new project will reside, copy any existing source files
  • Select File, New File or Project
  • Import Project
  • Import Existing Project (no source files need to actually exist)
  • Enter the Project name and location
  • A dialog will be displayed to select any source files or folders which should be included in your project
  • Select the version control system as needed
  • Finish

Edit Build File

Before you can build a few additional steps are required to configure Autotools and generate the actual build files. This part is only done once.

From the folloing link, there are three steps shown. Only steps 1 and 2 in must be run and this needs to occur in a bash prompt outside of Qt Creator. The remaining step 3 is run automatically by Qt Creator each time you compile and run.

Building with Autotools

We suggest you do not edit Configure.ac and Makefile.am files in Qt Creator unless the Visual Whitspace space option is enabled. These files are case sensitive and tab/space sensitive.

Configure Autotools

In order to build the project must be configured.

  • From the Projects tab click on the CopperSpice label in the Build and Run section
  • Under the CopperSpice label select Build
  • Modify the Build directory as needed, the directory entered must already exist
  • Update the following Build Settings entries
  • The make executable may be incorrect, modify to specify the Make.Exe from Msys
Key Value
Build Steps c:\Msys\bin\Make.exe
Ensure "all" is checked
Clean Steps c:\Msys\bin\Make.exe
Ensure "clean" is checked
Build Environment c:\Msys\bin;c:\MingW\bin
Add to Path if missing
  • Under the CopperSpice label select Run
  • Update the following Run Settings entires
  • Click on "Add Deploy Step" and select "Custom Process Step"
Key Value
Custom Process Step
  Command c:\Msys\bin\Make.exe
  Arguments install
Run
  Executable Path and name of your executable
  Working Directory %{buildDir}

Additional Configuration

If your application is designed to run in a terminal window you will need to check the box for "Run in Terminal" in Qt Creator. Select Projects, Run, and the checkbox will be located under the Run section.

Compile and Run

From the main Build menu select Run.