Saturday, October 20, 2012

Building With QtCreator

Now that it has been configured for all the tools, everything can be done inside QtCreator.  Start QtCreator and select New Project... on the File menu.  In the New dialog select Project from Version Control and then Git Repository Clone.  After clicking the Choose... button, the git repository can be selected.  For Clone URL: enter https://github.com/thunder422/ibcp.  If desired, change the Checkout path.  The Checkout directory will default to thunder422-ibcp.  Click the Next button and the repository will be cloned.

Once finished, the CMake Wizard dialog appears asking for the Build Location.  The default directory can be used.  The next dialog of the wizard is to Run CMake.  On Windows, the Generator: needs to be changed to MinGW Generator (MinGW (x86 32bit)) assuming MinGW 4.4 was installed with Qt SDK, otherwise this is the only generator available.

Clicking the Run CMake button at this point causes a bunch of errors.  Adding ‑G "MSYS Makefiles" to the Arguments: line appears to resolve the problem.  Adding this before clicking the Run CMake button the first time does not make it work though clicking a second time does.  Clicking the Run CMake button a second time works.  I have no explanation for this at the moment.  This is a similar problem that caused issues with NetBeans and CMake.  On Linux, clicking the Run CMake button is all that is necessary.

Adding ‑DCMAKE_BUILD_TYPE=Debug to the Arguments: line turns on debug information to that the debugger can be used. After CMake is run, the program can be built.  There are a number of ways to begin the build, including the Build menu, Ctrl+B and the hammer looking icon at the bottom of the tool bar on the left side.  The build can be monitored by clicking the 4 Compile Output button along the bottom of the screen.

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)