Results 1 to 6 of 6

Thread: Multiple project files in a single directory

  1. #1
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Exclamation Multiple project files in a single directory

    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
    Let your work talk for you

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multiple project files in a single directory

    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).

  3. #3
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Multiple project files in a single directory

    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.
    Let your work talk for you

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multiple project files in a single directory

    What are the exact errors you are getting?

  5. #5
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Multiple project files in a single directory

    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
    Let your work talk for you

  6. #6
    Join Date
    Dec 2007
    Posts
    40
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Multiple project files in a single directory

    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?
    Let your work talk for you

Similar Threads

  1. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  3. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  4. how do i use a same project in multiple systems ?
    By nhatkhang in forum KDE Forum
    Replies: 6
    Last Post: 21st December 2006, 16:32
  5. Replies: 2
    Last Post: 11th July 2006, 14:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.