0

Problem: I have subdirs template qmake project. Two in fact. They are unrelated. I was to include second subdir project (or more like certain subdirs of that project) into first one and start using that.

For example let the first project consists of A1, B1, C1 subprojects (subdirs with A|B|C1.pro) and second of A2, B2, C2. I want to include B2 and C2 into my first project so it becomes like this: A1, B1, C1, B2, C2 So I can start using classes and interfaces provided by B2 which depends on C2.

And I want to do it as less intrusive to second project as possible. The problem I'm encountering is that I'm trying to do this just by adding B2 and C2 .pro files to first project subdirs template and it can't build it because some class in B2 may have in it and compiler can't understand where to find it.

I can't find a simple (or just "right") way to do what I want - start using second project code as cleanly and sync-friendly as possible without resorting to copy-pasting everything I need into first project.

Dan M.
  • 3,818
  • 1
  • 23
  • 41
  • Can you perform synchronization through separate code repositories for subprjects B2 and C2? Will it be too much overhead? – Alexander Tyapkov Dec 07 '15 at 17:37
  • That's what I'm trying to do- having second project as github submodule and including parts of it as subprojects in the first one. But as I mentioned - I encounter problems with this method, – Dan M. Dec 07 '15 at 17:55
  • Ok!. I was thinking you are just on the way of direct copypasting the files from one project to another. So you are adding pro file and what is happening then? It is not quite clear for me. – Alexander Tyapkov Dec 07 '15 at 23:08
  • I can't build these subprojects from project 2 in the first one since it can't resolve some of the #include . – Dan M. Dec 08 '15 at 08:45
  • I got you..so project B2 and C2 have some dependencies in the second project and you cannot include them into the first project...hm..still don't have any clue how to solve it. – Alexander Tyapkov Dec 08 '15 at 09:03
  • I can build them independently, but If I include them from my other project it can't find them. Like B2 uses C2 classes with <> and I can build them fine. But If I include some header from B2 in B1 it fails with : no such file or directory in file included from B1/something.h. It's like that it somehow forgets about all include paths if I just try to include it from first project. (but between B2 and C2 there is no such problem and QtCreator auto suggests things just fine) – Dan M. Dec 08 '15 at 09:27

0 Answers0