Mercurial > projects > qtd
diff generator/main.cpp @ 4:0a29ce1ae854
CMake build script.
Small fixes in examples.
author | SokoL_SD |
---|---|
date | Wed, 13 May 2009 19:01:55 +0000 |
parents | e78566595089 |
children | 6cd923119ab1 |
line wrap: on
line diff
--- a/generator/main.cpp Wed May 13 17:34:40 2009 +0000 +++ b/generator/main.cpp Wed May 13 19:01:55 2009 +0000 @@ -75,6 +75,7 @@ QString typesystemFileName; QString pp_file = ".preprocessed.tmp"; QStringList rebuild_classes; + QString source_dir; QMap<QString, QString> args; @@ -150,7 +151,12 @@ } } + source_dir = args.value("source-directory"); fileName = args.value("arg-1"); + if (!source_dir.isEmpty()) + { + fileName = source_dir + "/" + fileName; + } typesystemFileName = args.value("arg-2"); if (args.contains("arg-3")) @@ -172,11 +178,10 @@ printf("Running the QtD Generator. Please wait while source files are being generated...\n"); - if (!TypeDatabase::instance()->parseFile(typesystemFileName)) + if (!TypeDatabase::instance()->parseFile(typesystemFileName, source_dir)) qFatal("Cannot parse file: '%s'", qPrintable(typesystemFileName)); - - if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"))) { + if (!Preprocess::preprocess(fileName, pp_file, args.value("include-paths"), source_dir, args.value("qt-include-directory"))) { fprintf(stderr, "Preprocessor failed on file: '%s'\n", qPrintable(fileName)); return 1; } @@ -212,8 +217,11 @@ printf("General:\n"); printf( " --cpp-shared \n" + " --qt-include-directory \n" + " --qt-directory \n" + " --source-directory \n" " --debug-level=[sparse|medium|full] \n" - " --d-target=[d1-tango|d2-phobos] \n" + " --d-target=[d1-tango|d2-phobos] \n" " --dump-object-tree \n" " --help, -h or -? \n" " --no-suppress-warnings \n"