Boost logo

Boost-Build :

From: Alo Sarv (alo17_at_[hidden])
Date: 2005-07-26 07:22:11


Attached Qt4 toolset; it's based on the Qt3 toolset file, with some
modifications. Namely:

* Library names differ on NT and unix - on NT, it's QtCored4, while on
unix, it's QtCore_debug
* -i flag on uic has been removed
* I was unable to figure out what <allow> does, so I had to remove it
for this to work.

Other than this, it should work just as the Qt3 toolset:

exe test : file.cpp gui.ui /qt4//QtGui4 ;

The libraries available at /qt4 are QtCore4, QtGui4, QtNetwork4,
Qt3Support4, QtOpenGL4, QtSql4 and QtXml4. Maybe the "4" suffix can be
dropped, since they'r already inside /qt4 project ?

Alo
 --------------010004000504090604040204 Content-Type: text/plain;
name="qt4.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="qt4.jam"

# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.

import modules ;
import feature ;
import errors ;
import type ;
import "class" : new ;
import generators ;
import project ;
import toolset : flags ;
import os ;

project.initialize $(__name__) ;
project qt4 ;

# Initialized the QT support module. The 'prefix' parameter
# tells where QT is installed. When not given, environmental
# variable QTDIR should be set.
rule init ( prefix ? )
{
if ! $(prefix)
{
prefix = [ modules.peek : QTDIR ] ;
if ! $(prefix)
{
errors.error
"QT installation prefix not given and QTDIR variable is empty" ;
}
}

if $(.initialized)
{
if $(prefix) != $(.prefix)
{
errors.error
"Attempt the reinitialize QT with different installation prefix" ;
}
}
else
{
.initialized = true ;
.prefix = $(prefix) ;
generators.register-standard qt4.moc : H : CPP(moc_%) ; # : <allow>qt4 ;
type.register UI : ui ;
type.register UIC_H : : H ;
generators.register-standard qt4.uic-h : UI : UIC_H ; # : <allow>qt4 ;

class qt4::uic-cpp-generator : generator
{
rule __init__ ( )
{
generator.__init__ qt4.uic-cpp : UI UIC_H : CPP ; # : <allow>qt4 ;
}
rule run ( project name ? : properties * : sources + : multiple )
{
local result ;
if ! $(sources[2])
{
result = [
generator.run $(project) $(name) : $(properties) : $(sources)
] ;
}
if $(result)
{
local action = [ $(result[1]).action ] ;
local sources = [ $(action).sources ] ;
local mocced = [
generators.construct $(project) $(name)
: CPP : $(properties) : $(sources[2])
] ;
result += $(mocced[2-]) ;
}
return $(result) ;
}
}
generators.register [ new qt4::uic-cpp-generator ] ;

local usage-requirements = <include>$(.prefix)/include <library-path>$(.prefix)/lib <dll-path>$(.prefix)/lib ;

# On NT, the libs have "4" suffix
local suffix ;
if [ os.name ] = NT
{
suffix_version = "4" ;
suffix_debug = "d" ;
} else {
suffix_version = "" ;
suffix_debug = "_debug" ;
}

lib QtCore4 :
: <name>QtCore$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtCore $(usage-requirements)
;
lib QtCore4 :
: <name>QtCore$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtCore $(usage-requirements) ;
lib QtGui4 : QtCore4
: <name>QtGui$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtGui ;
lib QtGui4 : QtCore4
: <name>QtGui$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtGui ;
lib QtNetwork4 : QtCore4
: <name>QtNetwork$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtNetwork ;
lib QtNetwork4 : QtCore4
: <name>QtNetwork$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtNetwork ;
lib Qt3Support4 :
: <name>Qt3Support$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/Qt3Support ;
lib Qt3Support4 :
: <name>Qt3Support$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/Qt3Support ;
lib QtOpenGL4 :
: <name>QtOpenGL$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtOpenGL ;
lib QtOpenGL4 :
: <name>QtOpenGL$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtOpenGL ;
lib QtSql4 :
: <name>QtSql$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtSql ;
lib QtSql4 :
: <name>QtSql$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtSql ;
lib QtXml4 :
: <name>QtXml$(suffix_version) <variant>release
:
: <include>$(.prefix)/include/QtXml ;
lib QtXml4 :
: <name>QtXml$(suffix_debug)$(suffix_version) <variant>debug
:
: <include>$(.prefix)/include/QtXml ;

}
}

rule directory
{
return $(.prefix) ;
}

actions moc
{
$(.prefix)/bin/moc -f $(>) -o $(<)
}

space = " " ;

flags qt4.uic-h LIBRARY_PATH <xdll-path> ;

actions uic-h
{
$(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH)
}

flags qt4.uic-cpp LIBRARY_PATH <xdll-path> ;

actions uic-cpp
{
$(.prefix)/bin/uic $(>[1]) -o $(<) -L$(space)$(LIBRARY_PATH)
}
 --------------010004000504090604040204--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk