Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remote compile in QtCreator

I am developing an application using QtCreator in Mac OS X and it must be cross-platform.

I have a Mac OS X as host. Also I have a MS Windows installed on virtual machine and a Ubuntu installed on another virtual machine:

  • Mac OS X: Qt 5.4.0 - 64bit - clang - Xcode 6.0
  • MS Windows: Qt 5.3.0 - 32bit - VC++ 2013
  • Ubuntu: Qt 5.3.0 - 64bit - GCC

How can I develop my application in Mac OS and build it in another platforms (Mac/Windows/Ubuntu) all at once?

Is there any remote compiler option in QtCreator?

like image 994
S.M.Mousavi Avatar asked Jan 19 '15 15:01

S.M.Mousavi


2 Answers

I use remote compilation from Windows. I created custom build step using plink, which lest me execute remote command using key authorization, which starts the build. Qt creator can even parse errors returned :)

Short instruction how to configure it:

  1. Create public key authentication for your user in putty and configure connection to your server: https://www.howtoforge.com/how-to-configure-ssh-keys-authentication-with-putty-and-linux-server-in-5-quick-steps

  2. Download plink: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

  3. In your QtCreator project configure "Custom Process Step" to connect to your server and start compilation. Assuming you have:

    • putty session to your build server configured and named CentOS7_local
    • user usename
    • project located in user home directory called projectname You can use something like (if you need some more sophisticated build start you can create a bash script on server and invoke it):

enter image description here

like image 104
Pawel Faron Avatar answered Oct 14 '22 22:10

Pawel Faron


I don't think you can remote compile in Qt Creator but you can use a continuous build system like Jenkins to setup a distributed build environment. Build slaves in all your VMs would compile on commit in your SCM like git or Subversion.

Advantages of this approach:

  • works on all major platforms like Linux, MacOS, Windows
  • .. and for all major compilers
  • you can build on any number of platforms regardless of Qt Creator support
  • you can get help easily because this is done in many professional systems
  • you can distribute your development
  • you can use any IDE
  • you have great flexibility and tons of plugins which make life easy

Note: There are many more CI systems out there, see here.

like image 28
frans Avatar answered Oct 14 '22 23:10

frans