qtCreator + Eclipse
http://azurvii.blogspot.com/2012/11/eclipse-qmake-general-purpose-building.html
-------------------------------------
Eclipse CDT: great C++ IDE
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:
-----------------------------------------------------------------------
your first should create a .pro file with "qmake -project" in the top
level directory of your project for generating a project file, then you
use "qmake" for generating your platform specific makefiles. After that
you can build your project with your platforms make tool. For more
details read the "QT Reference Documentation".
For easy use in Eclipse you can add the "qmake -project" and "qmake" to
your "External Tools".
* In Eclipse choose "Run" → "External Tools" → "External Tools…".
* Click "Program" and then "New".
* In the register "Main" in "Location" enter:
"C:\path_to_your_qt_directory\bin\qmake.exe", in "Working Directory"
enter: "${project_loc}" and in "Arguments" enter: "-project" then click
"Apply". In the register "Common" under "Display in favorites menu"
select "External Tools". In the register "Refresh" select "Refresh
resources upon completion". Give your new "External Tool" a name! Eg.
"qmake -project (generate .pro file)".
* Repeat the second step leaving the "Arguments"-Field empty and name it
"qmake".
For me code completion works perfectly, the include paths are dicovered
automatically. Cheers,
Jörg
-------------------------------------
Eclipse CDT: great C++ IDE
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
-----------------------------------------------------------------------
your first should create a .pro file with "qmake -project" in the top
level directory of your project for generating a project file, then you
use "qmake" for generating your platform specific makefiles. After that
you can build your project with your platforms make tool. For more
details read the "QT Reference Documentation".
For easy use in Eclipse you can add the "qmake -project" and "qmake" to
your "External Tools".
* In Eclipse choose "Run" → "External Tools" → "External Tools…".
* Click "Program" and then "New".
* In the register "Main" in "Location" enter:
"C:\path_to_your_qt_directory\bin\qmake.exe", in "Working Directory"
enter: "${project_loc}" and in "Arguments" enter: "-project" then click
"Apply". In the register "Common" under "Display in favorites menu"
select "External Tools". In the register "Refresh" select "Refresh
resources upon completion". Give your new "External Tool" a name! Eg.
"qmake -project (generate .pro file)".
* Repeat the second step leaving the "Arguments"-Field empty and name it
"qmake".
For me code completion works perfectly, the include paths are dicovered
automatically. Cheers,
Jörg
评论