From Van Essen Lab

Jump to: navigation, search


Using QtCreator

Setting up CMake in QtCreator

Editing Preferences

On Mac, select Preferences from the QtCreator Menu.

Setting up CMake in QtCreator 2

  • Select Projects in the column on the left of the Preferences Window.
  • Click the CMake tab at the top center.
  • Enter the full path to the cmake executable.

License Template

  • Select C++ in the column on the left.
  • Enter the path the the license file.

The license may contain %YEAR% and others.

NO Tabs

  • Select Text Editor in the column on the left.
  • Click the Behavior tab.
  • Check Insert spaces instead of tabs.
  • Set both Tab size and Indent size to 4.

Selecting Version of Qt

  • Select Qt4 in the column on the left.
  • If not Auto-detected, press the Add button on the right and use the file dialog to select the proper version of Qt. You will need to select the qmake executable in the Qt library's bin directory.

Version Control

  • Select Version Control in the Column on the left.
  • Select the Git tab at the top center.
  • Check Environment Variables and enter the path to the git executable.
  • At the bottom of the Miscellaneous section, check Pull with rebase.

Creating a CMake Project in Qt

  • Select File Menu->Open File or Project.
  • Use the Open File dialog to select and open the CMakeLists.txt file located in the project's src directory. This will launch the CMake Wizard dialog.
  • For Build Location, set the path to the project's build directory. The build directory should be located in the same directory as the project's src directory.
  • On the Run CMake page, press the Run CMake button.
  • After CMake completes, press the Done button.

Syntax Checking

QtCreator does some syntax checking while editing. While it will detect a missing semicolon, it does not seem to detect undeclared variables.

Personal tools
Sums Database