Qt Creator configure to open multiple projects in one project ?
-
@SPlatten said in Qt Creator configure to open multiple projects in one project ?:
How do I use add_subdirectory() in the pro file ?
You don't - it is for CMake.
Simply open your top level pro file with TEMPLATE = subdirs. -
@SPlatten add_subdirectory() is cmake only, you're using pro files -> qmake as build system
make a new pro file, make it
TEMPLATE = subdirs
add your sub dirs:
SUBDIRS = MainApplication \ ThCommunication
specify the path, if needed:
MainApplication.subdir = MainApplication ThCommunication.subdir = Dependencies/ThCommunication
specify dependencies, for example if you need the library before linking of your main application:
MainApplication.depends = ThCommunication
be aware, your pro file of your subprojects should have the same name as the folder it lives in. I haven't yet found a way around this restriction.
-
@SPlatten said in Qt Creator configure to open multiple projects in one project ?:
example_project.subdir = ../example_project/
Is your example_project really one level up?!
Usually such projects are structured like shown here: https://wiki.qt.io/SUBDIRS_-_handling_dependencies -
@SPlatten said in Qt Creator configure to open multiple projects in one project ?:
however I could move it up ?
Sure you can.
Check the path in the error you get - is it what it should be? Is there a pro file in that folder? -
@SPlatten said in Qt Creator configure to open multiple projects in one project ?:
I think I've done something wrong:
first of all, remove this
CONFIG += ordered
or I will start murdering puppies!it is named subdir for a reason, iirc
..
is not supported. And I'm almost certain that_PRO_FILE_
doesn't work either, as a SUBDIR propertyyour pro file has already the same name as the directory it is in, so you're fine in that regard
-
@SPlatten said in Qt Creator configure to open multiple projects in one project ?:
/home/.../example_project/
soo, what's the content of this folder ? can you check, that there is aexample_project.pro
in it?remove the trailing
/
./.../example_project/ -> ./.../example_project -
@J-Hilk , sorry to do this, can you please delete any posts where you have quoted my text or edit to remove quoted text. I am in trouble as I have mentioned project names in my posts that I should not have and as a result my contract has been terminated.
Thank you,
Simon