PDA

View Full Version : QMake problem



adhit
13th April 2009, 11:19
Hello! How can i use qmake program, to generate only Makefile without directories that qmake creates analyzing .pro file?
Thank you!

lyuts
13th April 2009, 11:48
What directories are you talking about?

adhit
13th April 2009, 12:01
For example i have .pro file:


TEMPLATE = lib
INCLUDEPATH = ../include \
../../common/libxml2/include \
../../common/iconv/include \
../../common/include
OUTPUT = ../../..
TEMP = ../../../temp/dstr/file
CONFIG += plugin
RCC_DIR = ./res
RESOURCES = ./res/resource.qrc

Debug {
DEFINES += _DEBUG
DESTDIR = $${OUTPUT}/debug
OBJECTS_DIR = $${TEMP}/debug
} else {
DESTDIR = $${OUTPUT}/release
OBJECTS_DIR = $${TEMP}/release
}

win32 {
LIBS += $${DESTDIR}/libxml2.lib
} else {
LIBS += -lxml2
}

MOC_DIR = $${OBJECTS_DIR}

PRECOMPILED_HEADER = std.h

HEADERS += header.h

SOURCES += main.cpp


I run qmake program:


C:\temp>qmake project.pro


Program generates files Makefile, Makefile.Release, Makefile.Debug and TEMP, DESTDIR and RCC_DIR directories, as they defined in .pro file.

But i only need Makefiles without generated directories.

spirit
13th April 2009, 12:04
don't specify these dirs, but in this case all automatically generated files will be in that directory where pro-file is located.

lyuts
13th April 2009, 12:23
I'm not sure if this is the right answer (i haven't tried this) but this is what i have found in qmake's doc:

-makefile

qmake output will be a Makefile.

http://doc.trolltech.com/4.5/qmake-running.html#syntax


Maybe this will end up in generating only makefiles.

A question to you. What is the problem with created directories? Why don't you want them to be created?

adhit
13th April 2009, 12:53
An option -makefile doesn't help, it still generates directories.

I need to parse .pro file. But instead of analyzing strings in .pro file, i decided to generate makefiles with qmake. And then anaylyze them by keywords. May be there are easier ways to parse .pro file...