Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Is there a way to generate multiple executable in the same project? (CMake)
Qt 6.11 is out! See what's new in the release blog

Is there a way to generate multiple executable in the same project? (CMake)

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 85 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    monegator
    wrote last edited by
    #1

    Hello,
    I have a couple of applications i'd like to merge into one. Currently, they are completely separate projects, even if ideally they would share a good portion of the code.

    Broad strokes, one configure a piece of hardware, and the other is just a barebones version that upload firmware and configuration from files, no editing required.
    Ideally i would have the Main software invoke the updater and it would show up as a modal dialog, without letting the user change the communication parameters etc.. or the operator could just launch the updater executable, and he would be met with the full UI.

    I tried dabbling with subprojects, but i'm not sure if it's the correct approach:

    1. Do i place all the common code (communication library, device specific classes, ...) in a subproject? Then the files should be available to be included in all projects?
    2. Can i compile all projects at once?
    3. How can i test all projects, or launch a debug session that lets me debug everything? That is probably the thing we can't do, i guess? Unless i open multiple instances of Qt Creator?

    Thanks for the help

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote last edited by
      #2

      Hello,
      you can have multiple executables in one CMake project, and deal with it in one single Qt Creator instance.
      As a template you can git clone "https://codereview.qt-project.org/qt/qtqa" and load .../src/fuzzgen/CMakeLists.txt in Qt Creator.
      It's a project with multiple executables. You can select the run target like that:

      016ed7d6-aad5-494c-b2e7-ff5a726f30ef-image.png

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved