📄 qt4.jam
字号:
# Copyright 2002-2006 Vladimir Prus# Copyright 2005 Alo Sarv# Copyright 2005-2006 Juergen Hunold## Distributed under the Boost Software License, Version 1.0. (See# accompanying file LICENSE_1_0.txt or copy at# http://www.boost.org/LICENSE_1_0.txt)# Qt4 library support module## The module attempts to auto-detect QT installation location from QTDIR# environment variable; failing that, installation location can be passed as# argument:## toolset.using qt4 : /usr/local/Trolltech/Qt-4.0.0 ;## The module supports code generation from .ui and .qrc files, as well as# running the moc preprocessor on headers. Note that you must list all your# moc-able headers in sources.## Example:## exe myapp : myapp.cpp myapp.h myapp.ui myapp.qrc# /qt4//QtGui /qt4//QtNetwork ;## It's also possible to run moc on cpp sources:## import cast ;## exe myapp : myapp.cpp [ cast _ moccable-cpp : myapp.cpp ] /qt4//QtGui ;## When moccing source file myapp.cpp you need to include "myapp.moc" from# myapp.cpp. When moccing .h files, the output of moc will be automatically# compiled and linked in, you don't need any includes.## This is consistent with Qt guidelines:# http://doc.trolltech.com/4.0/moc.htmlimport modules ;import feature ;import errors ;import type ;import "class" : new ;import generators ;import project ;import toolset : flags ;import os ;import virtual-target ;import scanner ;# Qt3Support control feature## Qt4 configure defaults to build Qt4 libraries with Qt3Support.# The autodetection is missing, so we default to disable Qt3Support.# This prevents the user from inadvertedly using a deprecated API.## The Qt3Support library can be activated by adding# "<qt3support>on" to requirements## Use "<qt3support>on:<define>QT3_SUPPORT_WARNINGS"# to get warnings about deprecated Qt3 support funtions and classes.# Files ported by the "qt3to4" conversion tool contain _tons_ of# warnings, so this define is not set as default.## Todo: Detect Qt3Support from Qt's configure data.# Or add more auto-configuration (like python).feature.feature qt3support : off on : propagated link-incompatible ;project.initialize $(__name__) ;project qt ;# Save the project so that we tolerate 'import + using' combo..project = [ project.current ] ;# Initialized the QT support module. The 'prefix' parameter tells where QT is# installed.#rule init ( prefix : full_bin ? : full_inc ? : full_lib ? ){ project.push-current $(.project) ; # pre-build paths to detect reinitializations changes local inc_prefix lib_prefix bin_prefix ; if $(full_inc) { inc_prefix = $(full_inc) ; } else { inc_prefix = $(prefix)/include ; } if $(full_lib) { lib_prefix = $(full_lib) ; } else { lib_prefix = $(prefix)/lib ; } if $(full_bin) { bin_prefix = $(full_bin) ; } else { bin_prefix = $(prefix)/bin ; } if $(.initialized) { if $(prefix) != $(.prefix) { errors.error "Attempt the reinitialize QT with different installation prefix" ; } if $(inc_prefix) != $(.incprefix) { errors.error "Attempt the reinitialize QT with different include path" ; } if $(lib_prefix) != $(.libprefix) { errors.error "Attempt the reinitialize QT with different library path" ; } if $(bin_prefix) != $(.binprefix) { errors.error "Attempt the reinitialize QT with different bin path" ; } } else { .initialized = true ; .prefix = $(prefix) ; # Setup prefixes for include, binaries and libs. .incprefix = $(.prefix)/include ; .libprefix = $(.prefix)/lib ; .binprefix = $(.prefix)/bin ; # Generates cpp files from header files using "moc" tool generators.register-standard qt4.moc : H : CPP(moc_%) : <allow>qt4 ; # The OBJ result type is a fake, 'H' will be really produced. See # comments on the generator class, defined below the 'init' function. generators.register [ new uic-h-generator qt4.uic-h : UI : OBJ : <allow>qt4 ] ; # The OBJ result type is a fake here too. generators.register [ new moc-h-generator qt4.moc.inc : MOCCABLE_CPP : OBJ : <allow>qt4 ] ; generators.register [ new moc-inc-generator qt4.moc.inc : MOCCABLE_H : OBJ : <allow>qt4 ] ; # Generates .cpp files from .qrc files. generators.register-standard qt4.rcc : QRC : CPP(qrc_%) ; # dependency scanner for wrapped files. type.set-scanner QRC : qrc-scanner ; # Test for a buildable Qt. if [ glob $(.prefix)/Jamroot ] { .bjam-qt = true # this will declare QtCore (and qtmain on <target-os>windows) add-shared-library QtCore ; } else # Setup common pre-built Qt. # Special setup for QtCore on which everything depends { local usage-requirements = <include>$(.incprefix) <library-path>$(.libprefix) <dll-path>$(.libprefix) <threading>multi <allow>qt4 ; local suffix ; if [ os.name ] = NT { # On NT, the libs have "4" suffix, and "d" suffix in debug # builds. Also, on NT we must link against the qtmain library # (for WinMain). .suffix_version = "4" ; .suffix_debug = "d" ; lib qtmain : # sources : # requirements <name>qtmain$(.suffix_debug) <variant>debug ; lib qtmain : # sources : # requirements <name>qtmain ; main = qtmain ; } else if [ os.name ] = MACOSX { # On MacOS X, both debug and release libraries are available. .suffix_version = "" ; .suffix_debug = "_debug" ; } else { # Since Qt-4.2, debug versions on unix have to be built # separately and therefore have no suffix. .suffix_version = "" ; .suffix_debug = "" ; } lib QtCore : $(main) : # requirements <name>QtCore$(.suffix_version) : # default-build : # usage-requirements <define>QT_CORE_LIB <define>QT_NO_DEBUG <include>$(.incprefix)/QtCore $(usage-requirements) ; lib QtCore : $(main) : # requirements <name>QtCore$(.suffix_debug)$(.suffix_version) <variant>debug : # default-build : # usage-requirements <define>QT_CORE_LIB <include>$(.incprefix)/QtCore $(usage-requirements) ; } # Initialising the remaining libraries is canonical add-shared-library QtGui : QtCore : QT_GUI_LIB ; add-shared-library QtNetwork : QtCore : QT_NETWORK_LIB ; add-shared-library QtSql : QtCore : QT_SQL_LIB ; add-shared-library QtXml : QtCore : QT_XML_LIB ; add-shared-library Qt3Support : QtGui QtNetwork QtXml QtSql : QT_QT3SUPPORT_LIB QT3_SUPPORT : <qt3support>on ; # Dummy target to enable "<qt3support>off" and # "<library>/qt//Qt3Support" at the same time. This enables quick # switching from one to the other for test/porting purposes. alias Qt3Support : : : : <qt3support>off ; # OpenGl Support add-shared-library QtOpenGL : QtGui : QT_OPENGL_LIB ; # SVG-Support (Qt 4.1) add-shared-library QtSvg : QtXml QtOpenGL : QT_SVG_LIB ; # Test-Support (Qt 4.1) add-shared-library QtTest : QtCore ; # Qt designer library add-shared-library QtDesigner : QtGui QtXml ; # Support for dynamic Widgets (Qt 4.1) add-static-library QtUiTools : QtGui QtXml ; # DBus-Support (Qt 4.2) add-shared-library QtDBus : QtXml ; # Script-Engine (Qt 4.3) add-shared-library QtScript : QtGui QtXml ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -