From c0522c6ea0c0d5aced4bf995ed5aa6f2f9c340ed Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 26 May 2003 14:44:24 +0000 Subject: [PATCH] Change the QT toolset to use new standalone project feature. [SVN r18545] --- new/builtin.jam | 6 ++++++ new/qt.jam | 37 ++++++++++++++++++++----------------- v2/qt.jam | 37 ++++++++++++++++++++----------------- v2/tools/builtin.jam | 6 ++++++ 4 files changed, 52 insertions(+), 34 deletions(-) diff --git a/new/builtin.jam b/new/builtin.jam index 0f6a38d40..22845a3aa 100644 --- a/new/builtin.jam +++ b/new/builtin.jam @@ -66,6 +66,12 @@ feature location : : free path ; feature dll-path : : free path ; feature hardcode-dll-paths : false true : incidental propagated ; +# This feature is used to allow specific generators to run. +# For example, QT tools can only be invoked when QT library +# is used. In that case, qt will be in usage requirement +# of the library. +feature allow : : free ; + # Windows-specific features diff --git a/new/qt.jam b/new/qt.jam index bf1310784..5ad929d7e 100644 --- a/new/qt.jam +++ b/new/qt.jam @@ -9,6 +9,13 @@ import errors ; import type ; import class : class new ; import generators ; +import project ; + +# 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 @@ -39,14 +46,14 @@ rule init ( prefix ? ) .prefix = $(prefix) ; feature.extend uses : qt ; - feature.action qt : add-properties ; + #feature.action qt : add-properties ; - generators.register-standard qt.moc : H : CPP(moc_%) : qt ; + generators.register-standard qt.moc : H : CPP(moc_%) : qt ; type.register UI : ui ; type.register UIC_H : : H ; - generators.register-standard qt.uic-h : UI : UIC_H : qt ; + 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 @@ -75,23 +82,19 @@ rule init ( prefix ? ) class qt.uic-cpp-generator : generator ; 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) ; } } -rule add-properties ( property : properties * ) -{ - local lib-name ; - if multi in $(properties) - { - lib-name = qt-mt ; - } - else - { - lib-name = qt ; - } - return $(.prefix)/include $(.prefix)/lib $(.prefix)/lib $(lib-name) ; -} - # -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. diff --git a/v2/qt.jam b/v2/qt.jam index bf1310784..5ad929d7e 100644 --- a/v2/qt.jam +++ b/v2/qt.jam @@ -9,6 +9,13 @@ import errors ; import type ; import class : class new ; import generators ; +import project ; + +# 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 @@ -39,14 +46,14 @@ rule init ( prefix ? ) .prefix = $(prefix) ; feature.extend uses : qt ; - feature.action qt : add-properties ; + #feature.action qt : add-properties ; - generators.register-standard qt.moc : H : CPP(moc_%) : qt ; + generators.register-standard qt.moc : H : CPP(moc_%) : qt ; type.register UI : ui ; type.register UIC_H : : H ; - generators.register-standard qt.uic-h : UI : UIC_H : qt ; + 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 @@ -75,23 +82,19 @@ rule init ( prefix ? ) class qt.uic-cpp-generator : generator ; 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) ; } } -rule add-properties ( property : properties * ) -{ - local lib-name ; - if multi in $(properties) - { - lib-name = qt-mt ; - } - else - { - lib-name = qt ; - } - return $(.prefix)/include $(.prefix)/lib $(.prefix)/lib $(lib-name) ; -} - # -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. diff --git a/v2/tools/builtin.jam b/v2/tools/builtin.jam index 0f6a38d40..22845a3aa 100644 --- a/v2/tools/builtin.jam +++ b/v2/tools/builtin.jam @@ -66,6 +66,12 @@ feature location : : free path ; feature dll-path : : free path ; feature hardcode-dll-paths : false true : incidental propagated ; +# This feature is used to allow specific generators to run. +# For example, QT tools can only be invoked when QT library +# is used. In that case, qt will be in usage requirement +# of the library. +feature allow : : free ; + # Windows-specific features