Subversion Repositories DevTools

Rev

Rev 1150 | Rev 5842 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1150 Rev 1152
Line 1... Line 1...
1
########################################################################
1
########################################################################
2
# Copyright (C) 2008 ERG Limited, All rights reserved
2
# Copyright (C) 1998-2012 Vix Technology, All rights reserved
3
#
3
#
4
# Module name   : qt-builder.pm
4
# Module name   : qt-builder.pm
5
# Module type   : Makefile system
5
# Module type   : Makefile system
6
# Compiler(s)   : Perl
6
# Compiler(s)   : Perl
7
# Environment(s): jats
7
# Environment(s): jats
8
#
8
#
9
# Description   : Provide JATS build support for the QT SDK
9
# Description   : Provide JATS build support for the QT SDK
10
#                 This module hoosk into the internals of JATS
10
#                 This module hooks into the internals of JATS
11
#                 It tries to be generic, buts its not easy
11
#                 It tries to be generic, buts its not easy
12
#
12
#
13
#......................................................................#
13
#......................................................................#
14
 
14
 
15
require 5.008_002;
15
require 5.008_002;
Line 26... Line 26...
26
#
26
#
27
#   Local variables
27
#   Local variables
28
#
28
#
29
my $qt_package;                         # Ref to package containing QT
29
my $qt_package;                         # Ref to package containing QT
30
my %qt_used;                            # Track Used items
30
my %qt_used;                            # Track Used items
-
 
31
my @moc_defs;                           # Defines for MOC
31
 
32
 
32
#-------------------------------------------------------------------------------
33
#-------------------------------------------------------------------------------
33
# Function        : BEGIN
34
# Function        : BEGIN
34
#
35
#
35
# Description     : Setup directive hooks
36
# Description     : Setup directive hooks
Line 82... Line 83...
82
    RegisterSrcHook ('.ui',  \&src_hook_ui );
83
    RegisterSrcHook ('.ui',  \&src_hook_ui );
83
    RegisterSrcHook ('.h',   \&src_hook_h );
84
    RegisterSrcHook ('.h',   \&src_hook_h );
84
    RegisterSrcHook ('.cpp', \&src_hook_cpp );
85
    RegisterSrcHook ('.cpp', \&src_hook_cpp );
85
    RegisterSrcHook ('.ts',  \&src_hook_ts );
86
    RegisterSrcHook ('.ts',  \&src_hook_ts );
86
 
87
 
-
 
88
    # Register a function to be called just before we start to
-
 
89
    # generate makefiles. This will be used to process the data
-
 
90
    #
-
 
91
    RegisterMakefileGenerate (\&qtBuilder_Generate);
-
 
92
 
87
    #
93
    #
88
    #   Files will be placed into the OBJDIR
94
    #   Files will be placed into the OBJDIR
89
    #   Ensure that the compiler searches this directory
95
    #   Ensure that the compiler searches this directory
90
    #
96
    #
91
    AddIncDir( '*' , "\$(OBJDIR)", '--NoWarn' );
97
    AddIncDir( '*' , "\$(OBJDIR)", '--NoWarn' );
Line 199... Line 205...
199
################################################################################
205
################################################################################
200
    }
206
    }
201
}
207
}
202
 
208
 
203
#-------------------------------------------------------------------------------
209
#-------------------------------------------------------------------------------
-
 
210
# Function        : AddMocFlags
-
 
211
#
-
 
212
# Description     : Provide a definition to the MOC file genorator AND the
-
 
213
#                   C / C++ compiler
-
 
214
#
-
 
215
# Inputs          : $platforms              - Standard platform args
-
 
216
#                   @defs                   - Flags passed to the Moc
-
 
217
#
-
 
218
# Returns         : Nothing
-
 
219
#
-
 
220
sub AddMocFlags
-
 
221
{
-
 
222
    my ($platforms, @args) = @_;
-
 
223
    Debug( "AddMocFlags: ",$platforms, @args );
-
 
224
    return if ( ! ActivePlatform($platforms) );
-
 
225
 
-
 
226
    #
-
 
227
    #   Save for later
-
 
228
    #
-
 
229
    push @moc_defs, @args;
-
 
230
}
-
 
231
 
-
 
232
 
-
 
233
 
-
 
234
#-------------------------------------------------------------------------------
204
# Function        : src_hook_qrc
235
# Function        : src_hook_qrc
205
#
236
#
206
# Description     : This function will be invoked when a .QRC file
237
# Description     : This function will be invoked when a .QRC file
207
#                   is encountered in the Src directive
238
#                   is encountered in the Src directive
208
#
239
#
Line 511... Line 542...
511
    #   Append the generated file to a list
542
    #   Append the generated file to a list
512
    #
543
    #
513
    push( @::QT_PMFILES, "${base}.qm" );
544
    push( @::QT_PMFILES, "${base}.qm" );
514
}
545
}
515
 
546
 
-
 
547
#-------------------------------------------------------------------------------
-
 
548
# Function        : qtBuilder_Generate
-
 
549
#
-
 
550
# Description     : Insert definitions into the makefile
-
 
551
#                   Registered function to be called just before we start
-
 
552
#                   creating the makefile
-
 
553
#
-
 
554
# Inputs          : None
-
 
555
#
-
 
556
# Returns         : 
-
 
557
#
-
 
558
sub qtBuilder_Generate
-
 
559
{
-
 
560
    AddCFlags( '*', '--NoWarn', @moc_defs );
-
 
561
    Define ("# Definitions created by the AddMocFlags directive");
-
 
562
    Define ("MOC_FLAGS  =");
-
 
563
    foreach my $flag ( @moc_defs )
-
 
564
    {
-
 
565
        Define ("MOC_FLAGS +=" . $flag);
-
 
566
    }
-
 
567
}
516
 
568
 
517
1;
569
1;