JR Lawhorne
JR Lawhorne

Reputation: 3302

How do I specifiy an object directory in a Qt project file?

I am building a console Qt project.

Currently, my project file looks like this:

CONFIG += qt console debug 
CONFIG -= app_bundle

HEADERS = HelperClass.h
SOURCES = HelperClass.cpp \
            main.cpp
TARGET = doit

My QMAKESPEC environment variable is set to: macx-g++

I go to the directory with the project (and source) files and run qmake (which builds a Makefile) then make to build the project. The object files (*.o) from the compilation are placed in the same directory with my source and the executable.

How do I configure this build to place those object files in a sub directory so they don't pollute my source area?

Upvotes: 2

Views: 3440

Answers (1)

Jesse Vogt
Jesse Vogt

Reputation: 16499

set OBJECTS_DIR:

OBJECTS_DIR = ../myproject/tmp

See http://doc.qtsoftware.com/4.5/qmake-variable-reference.html#objects-dir

Upvotes: 4

Related Questions