PDA

View Full Version : Multiple project files in a single directory



jogeshwarakundi
15th July 2008, 07:11
Hi,
I have a module where I have the sources bundled, but I would have to build multiple libraries out of it. I have tried to write multiple project files in the same directory and choosing to compile them individually with "qtopiamake xyz.pro". the qtopiamake goes through, but the make command fails. It springs up and error and says may be I would want to use the -project option while qtopiamake. I could create multiple sub-directories for each project file, but I would prefer a cleaner solution. I tried on net, but could not find anything :(
Please help :crying:

wysota
15th July 2008, 07:41
Create a single ("master") project file with a SUBDIRS template and in the SUBDIRS variable place filenames of all subprojects in your project (they don't have to be in separate subdirectories, contrary to what the name suggests).

jogeshwarakundi
15th July 2008, 08:09
Thanks for the reply wysota, but this springs up some other problems :(
I always have trouble writing qtopia pro files from qmake documentation.
I have written as directed and still get the same error.
I have abc.pro and def.pro which are of type qtopia_project(qtopia lib) and generate .so files. I have added a compile.pro as below:


qtopia_project(qtopia subdirs)

SUBDIRS = abc.pro \
def.pro

I also tried to add the lines TEMPLATE = subdirs and CONFIG += subdirs but with no affect. Where am I going wrong?

PS: All three files are present in the same directory. src and hdr directories contain the sources and headers respectively.

wysota
15th July 2008, 09:15
What are the exact errors you are getting?

jogeshwarakundi
15th July 2008, 09:24
here it is:



/home/aj/softwares/qtbuild/src/build/bin/runwithvars.sh QMAKEFEATURES=/home/aj/softwares/qtopia-opensource-4.3.0/src/build QTDIR=/home/aj/softwares/qtbuild/qtopiacore/target INSTALL_ROOT=/home/aj/softwares/qtbuild/image IMAGE=/home/aj/softwares/qtbuild/image DIMAGE=/home/aj/softwares/qtbuild/dimage SDKROOT=/home/aj/softwares/qtbuild PROJECT_ROOT=. MAKE=/usr/local/bin/make /home/aj/softwares/qtbuild/bin/qtopiamake -makemakefile "compile.pro"
/home/aj/softwares/qtbuild/qtopiacore/target/bin/qmake -o ./Makefile.target -spec /home/aj/softwares/qtopia-opensource-4.3.0/qtopiacore/qt/mkspecs/qws/linux-generic-g++ SRCDIR=. QTOPIA_ID=
Usage: /home/aj/softwares/qtbuild/qtopiacore/target/bin/qmake [mode] [options] [files]

QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project

Mode:
-project Put qmake into project file generation mode
In this mode qmake interprets files as files to
be built,
defaults to *.c; *.ui; *.y; *.l; *.ts; *.qrc; *.h; *.hpp; *.hh; *.hxx; *.H; *.cpp; *.cc; *.cxx; *.C
-makefile Put qmake into makefile generation mode (default)
In this mode qmake interprets files as project files to
be processed, if skipped qmake will try to find a project
file in your current working directory

Warnings Options:
-Wnone Turn off all warnings
-Wall Turn on all warnings
-Wparser Turn on parser warnings
-Wlogic Turn on logic warnings

Options:
* You can place any variable assignment in options and it will be *
* processed as if it was in [files]. These assignments will be parsed *
* before [files]. *
-o file Write output to file
-unix Run in unix mode
-win32 Run in win32 mode
-macx Run in Mac OS X mode
-d Increase debug level
-t templ Overrides TEMPLATE as templ
-tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
-help This help
-v Version information
-after All variable assignments after this will be
parsed after [files]
-norecursive Don't do a recursive search
-recursive Do a recursive search
-cache file Use file as cache [makefile mode only]
-spec spec Use spec as QMAKESPEC [makefile mode only]
-nocache Don't use a cache file [makefile mode only]
-nodepend Don't generate dependencies [makefile mode only]
-nomoc Don't generate moc targets [makefile mode only]
-nopwd Don't look for files in pwd [project mode only]

Died at /home/aj/softwares/qtbuild/bin/qtopiamake line 516.
make: *** [regenerate] Error 2

jogeshwarakundi
17th July 2008, 07:03
I went through some examples which used the subdirs template and one difference I have noticed is they have


qtopia_project(subdirs)

apart from this, no other difference. But they all had the .pro files in other directories but never in the same.
So is it really possible to do it that way? or shall we HAVE to have a separate directory per pro file and limit to one target per pro file?