Results 1 to 4 of 4

Thread: QtCreator 4.5.1--Automate Deployment to multiple devices?

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QtCreator 4.5.1--Automate Deployment to multiple devices?

    I have a project that requires a compile time constant to be different for each target device (a security key).

    Currently, I change the constant in the .pro file something like this:

    DEFINES += KEY=\\"756eca076894f288182951f4e02191e2\\"

    The key is specific to each target device.

    When I want to deploy to a different device, I use "Manage Kits"->Manage and change the host name (ip address).

    Right now I have a set of 10 devices I'm testing (they interact with each oth) and I need to deploy to all of them when I make a code change.

    I could create a different project for each device--the project would only different in that one line in the .pro file and the target device's ip.

    Is there a better way to do this? Like export a makefile and edit it do 10 builds, with each build deploying to a different device?

  2. #2
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCreator 4.5.1--Automate Deployment to multiple devices?

    I guess I can use qmake to create a makefile and wrapped it with a script that changes the symbolic constant, builds, and executes the deploy steps that I have configured in the qtcreator project. Once for each target.

    If there's a better way, I'd like to know about it.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtCreator 4.5.1--Automate Deployment to multiple devices?

    Is the key / device pairing constant for every build iteration? (That is, the same device always has the same key?)

    If so, this might be something you can automate with CMake. A top level CMakelist project with ten CMakelist subprojects. The top level project fires off the build of each subproject, and within each subproject, the script references the same source code but contains a different compile time define for the key and builds to a different output directory. Building a new release is as simple as running CMake on the top level.

    This will work even if the keys change with each build; just add an extra step in each subproject build to generate a key and write it to a file that gets #include where needed in the source code. CMake has commands to execute other programs as part of a build.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. The following user says thank you to d_stranz for this useful post:

    davethomaspilot (4th November 2023)

  5. #4
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtCreator 4.5.1--Automate Deployment to multiple devices?

    Didn't check back in time!

    I ended up creating a makefile and editing it. But, what you suggest sounds better.

    But, I need to get up to speed on how to use CMake instead of the .pro file. Must do now--I'm moving up to QT6, cross-compiling for RPI Bookworm. So, I have to figure out how to change my .pro files to use CMake, I guess...

    I'll do a little research, maybe post a question.

Similar Threads

  1. Replies: 2
    Last Post: 15th January 2016, 18:11
  2. Qt Creator Deploying to Multiple Devices
    By Brandybuck in forum Qt Tools
    Replies: 3
    Last Post: 6th September 2014, 08:04
  3. How to distinguish multiple Keyboards (HID devices)
    By nardev in forum Qt Programming
    Replies: 2
    Last Post: 29th April 2013, 18:57
  4. Replies: 2
    Last Post: 28th February 2013, 20:47
  5. QtCreator project multiple targets
    By thru in forum Qt Tools
    Replies: 1
    Last Post: 17th March 2011, 07:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.