Qt creator custom compilation and running steps

Source: Internet
Author: User

I have been using QT Creator for development. This is because there are not many c ++ ide options in Linux. At the same time, because I have abandoned MFC, I usually have to rely on QT to write a small tool, which is exactly used in one fell swoop.

Use QT creator to develop general projects without modifying the compilation and running steps. Compilation and running are completed with one click. However, a multi-process project like mine is managed by a general project, which is divided into multiple sub-projects.

Other processes must be started by one process during the runtime, but the files compiled by QT are separated.

It is inconvenient to manage so many folders, and different processes need to read the same configuration file, and the path is not properly configured. So I had to put them under the build folder during compilation.
Click "project" on the left of QT creator and set the process project.

First, create a build folder. Enter/bin/mkdir or mkdir in the command, and set the parameter to-P build. Because the build directory may already exist, the-p parameter must be required. Otherwise, QT creator considers this step to fail and terminates the execution of other steps. Then add a building step to copy the compiled file to the build directory. The command is/bin/CP and the parameter is-RF common/common logengine/logengine dataserver/dataserver build.

At this point, the build step has been added. Run the build. The following output is displayed in the compilation output.

You can view the corresponding build directory to see that the corresponding running file already exists. The following are the configuration clearing and running steps, which are basically the same as the above process.

PS: At first, I saw a path like % {builddir} exists. I thought there would also be a variable like % {target. In this way, I do not need to write variables such as common and common, so that I can change the file name later. But I was not disappointed. The available variables I have found are as follows (maybe more ):

Http://doc.qt.digia.com/qtcreator-2.3/creator-build-settings.html
% {Currentproject: name}
% {Currentkit: filesystemname}
% {Currentbuild: name}
% {Builddir}
% {Sourcedir}

Qt creator custom compilation and running steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.