From 71c1fbd9804ca79e3e2f055223585cd790039e86 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 22 Mar 2006 10:16:38 +0000 Subject: [PATCH] Remove qt.jam as it's moved to qt3.jam. [SVN r33438] --- src/tools/qt.jam | 208 ----------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 src/tools/qt.jam diff --git a/src/tools/qt.jam b/src/tools/qt.jam deleted file mode 100644 index a8d8839da..000000000 --- a/src/tools/qt.jam +++ /dev/null @@ -1,208 +0,0 @@ -# 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 ; - -# Convert this module into a project, so that we can declare -# targets here. - -project.initialize $(__name__) ; -project qt ; - -# 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 qt.moc : H : CPP(moc_%) : qt ; - # Note: the OBJ target type here is fake, take a look - # at qt4.jam/uic-h-generator for explanations that - # apply in this case as well. - generators.register [ new moc-h-generator - qt.moc.cpp : MOCCABLE_CPP : OBJ : qt ] ; - - # The UI type is defined in types/qt.jam, - # and UIC_H is only used in qt.jam, but not in qt4.jam, so - # define it here. - type.register UIC_H : : H ; - - generators.register-standard qt.uic-h : UI : UIC_H : qt ; - - # The following generator is used to convert UI files to CPP - # It creates UIC_H from UI, and constructs CPP from UI/UIC_H - # In addition, it also returns UIC_H target, so that it can bee - # mocced. - class qt::uic-cpp-generator : generator - { - rule __init__ ( ) - { - generator.__init__ qt.uic-cpp : UI UIC_H : CPP : qt ; - } - - rule run ( project name ? : properties * : sources + ) - { - # Consider this: - # obj test : test_a.cpp : off ; - # - # This generator will somehow be called in this case, and, - # will fail -- which is okay. However, if there are - # properties they will be converted to sources, so the size of - # 'sources' will be more than 1. In this case, the base generator - # will just crash -- and that's not good. Just use a quick test - # here. - - local result ; - if ! $(sources[2]) - { - # Construct CPP as usual - result = [ generator.run $(project) $(name) - : $(properties) : $(sources) ] ; - - # If OK, process UIC_H with moc. It's pretty clear that - # the object generated with UIC will have Q_OBJECT macro. - 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 qt::uic-cpp-generator ] ; - - # Finally, declare prebuilt target for QT library. - local usage-requirements = - $(.prefix)/include - $(.prefix)/lib - $(.prefix)/lib - qt - ; - lib qt : : qt-mt multi : : $(usage-requirements) ; - lib qt : : qt single : : $(usage-requirements) ; - } -} - -class moc-h-generator : generator -{ - rule __init__ ( * : * ) - { - generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; - } - - rule run ( project name ? : property-set : sources * ) - { - if ! $(sources[2]) && [ $(sources[1]).type ] = MOCCABLE_CPP - { - name = [ $(sources[1]).name ] ; - name = $(name:B) ; - - local a = [ new action $(sources[1]) : qt.moc.cpp : - $(property-set) ] ; - - local target = [ - new file-target $(name) : MOC : $(project) : $(a) ] ; - - local r = [ virtual-target.register $(target) ] ; - - # Since this generator will return H target, the linking generator - # won't use it at all, and won't set any dependency on it. - # However, we need to target to be seen by bjam, so that dependency - # from sources to this generated header is detected -- if jam does - # not know about this target, it won't do anything. - DEPENDS all : [ $(r).actualize ] ; - - return $(r) ; - } - } -} - - -# Query the installation directory -# This is needed in at least two scenarios -# First, when re-using sources from the Qt-Tree. -# Second, to "install" custom Qt plugins to the Qt-Tree. -rule directory -{ - return $(.prefix) ; -} - -# -f forces moc to include the processed source file. -# Without it, it would think that .qpp is not a header and would not -# include it from the generated file. -actions moc -{ - $(.prefix)/bin/moc -f $(>) -o $(<) -} - -# When moccing .cpp files, we don't need -f, otherwise generated -# code will include .cpp and we'll get duplicated symbols. -actions moc.cpp -{ - $(.prefix)/bin/moc $(>) -o $(<) -} - - -space = " " ; - -# Sometimes it's required to make 'plugins' available during -# uic invocation. To help with this we add paths to all dependency -# libraries to uic commane line. The intention is that it's possible -# to write -# -# exe a : ... a.ui ... : some_plugin ; -# -# and have everything work. We'd add quite a bunch of unrelated paths -# but it won't hurt. -flags qt.uic-h LIBRARY_PATH ; -actions uic-h -{ - $(.prefix)/bin/uic $(>) -o $(<) -L$(space)$(LIBRARY_PATH) -} - -flags qt.uic-cpp LIBRARY_PATH ; -# The second target is uic-generated header name. It's placed in -# build dir, but we want to include it using only basename. -actions uic-cpp -{ - $(.prefix)/bin/uic $(>[1]) -i $(>[2]:D=) -o $(<) -L$(space)$(LIBRARY_PATH) -} - -