QMake: simple but powerful make-based build system
QMake does not work only for Qt toolkit, it could be used for other projects.
How I set up CDT + QMake:
- get CDT and Qt
- configure CDT to what you like (e.g. showing line number, etc.)
- add 2 external tools running at project location, one runs
qmake -project
, and another doesqmake -spec macx-g++
qmake -project
is used to scan the folders, and pick out what will be c++ compile. It will generate a .pro fileqmake
alone (or with-spec
) will read the .pro file and generate the actual Makefile.- make a qmake.conf file to be included in the .pro file (with a line of
include(qmake.conf)
). This is to separate special settings from the .pro file, which would get erased when qmake -project is run. - Sample qmake.conf
CONFIG -= qt CONFIG += release TARGET = test2 DESTDIR = build MOC_DIR = build RCC_DIR = build OBJECTS_DIR = build INCLUDEPATH += /my/own/include #LIBS += -L/usr/local/lib -L/opt/local/lib -lglfw -lGLEW -lglut -lGLU -lGL QMAKE_CXXFLAGS += -F/System/Library/Frameworks QMAKE_LFLAGS += -F/System/Library/Frameworks LIBS += -framework GLUT -framework OpenGL
No comments:
Post a Comment