diff options
author | axis <qt-info@nokia.com> | 2010-02-16 11:53:07 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-02-16 11:53:07 (GMT) |
commit | 15b08dffc1354bc816b04901a7442679382b0935 (patch) | |
tree | 783af85b75f9de3ab10902c5ba66cf5e22b2fe61 /qmake/option.cpp | |
parent | 9f5b02406f38fe02a27de7843b9f8a11232d2064 (diff) | |
parent | 9d174f13e48730ac06aa429e0f011a02b333025e (diff) | |
download | Qt-15b08dffc1354bc816b04901a7442679382b0935.zip Qt-15b08dffc1354bc816b04901a7442679382b0935.tar.gz Qt-15b08dffc1354bc816b04901a7442679382b0935.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts:
configure
mkspecs/common/symbian/symbian.conf
mkspecs/features/symbian/application_icon.prf
qmake/generators/makefile.cpp
qmake/generators/symbian/initprojectdeploy_symbian.cpp
qmake/generators/symbian/symmake.cpp
tools/assistant/tools/assistant/assistant.pro
Diffstat (limited to 'qmake/option.cpp')
-rw-r--r-- | qmake/option.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/qmake/option.cpp b/qmake/option.cpp index aa11ec1..ec3fea2 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -136,6 +136,20 @@ static Option::QMAKE_MODE default_mode(QString progname) return Option::QMAKE_GENERATE_MAKEFILE; } +static QString detectProjectFile(const QString &path) +{ + QString ret; + QDir dir(path); + if(dir.exists(dir.dirName() + Option::pro_ext)) { + ret = dir.filePath(dir.dirName()) + Option::pro_ext; + } else { //last try.. + QStringList profiles = dir.entryList(QStringList("*" + Option::pro_ext)); + if(profiles.count() == 1) + ret = dir.filePath(profiles.at(0)); + } + return ret; +} + QString project_builtin_regx(); bool usage(const char *a0) { @@ -322,12 +336,18 @@ Option::parseCommandLine(int argc, char **argv, int skip) if(!fi.makeAbsolute()) //strange arg = fi.filePath(); if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || - Option::qmake_mode == Option::QMAKE_GENERATE_PRL) + Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { + if(fi.isDir()) { + QString proj = detectProjectFile(arg); + if (!proj.isNull()) + arg = proj; + } Option::mkfile::project_files.append(arg); - else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) + } else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { Option::projfile::project_dirs.append(arg); - else + } else { handled = false; + } } if(!handled) { return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR; @@ -495,15 +515,9 @@ Option::init(int argc, char **argv) //try REALLY hard to do it for them, lazy.. if(Option::mkfile::project_files.isEmpty()) { - QString pwd = qmake_getpwd(), - proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext; - if(QFile::exists(proj)) { + QString proj = detectProjectFile(qmake_getpwd()); + if(!proj.isNull()) Option::mkfile::project_files.append(proj); - } else { //last try.. - QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext)); - if(profiles.count() == 1) - Option::mkfile::project_files.append(pwd + "/" + profiles[0]); - } #ifndef QT_BUILD_QMAKE_LIBRARY if(Option::mkfile::project_files.isEmpty()) { usage(argv[0]); |