Is there a way to generate multiple executable in the same project? (CMake)
-
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:
- 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?
- Can i compile all projects at once?
- 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
-
Hello,
you can have multiple executables in one CMake project, and deal with it in one single Qt Creator instance.
As a template you cangit clone "https://codereview.qt-project.org/qt/qtqa"and load.../src/fuzzgen/CMakeLists.txtin Qt Creator.
It's a project with multiple executables. You can select the run target like that: