Subversion Repositories DevTools

Rev

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

Rev 1152 Rev 5842
Line 20... Line 20...
20
#
20
#
21
#   Global Varibales
21
#   Global Varibales
22
#
22
#
23
our %SRC_DEPEND;                        # Source file dependencies
23
our %SRC_DEPEND;                        # Source file dependencies
24
our %SRC_ARGS;                          # Source file arguments
24
our %SRC_ARGS;                          # Source file arguments
-
 
25
our @RCC;                               # List of compiled resource files
25
 
26
 
26
#
27
#
27
#   Local variables
28
#   Local variables
28
#
29
#
29
my $qt_package;                         # Ref to package containing QT
30
my $qt_package;                         # Ref to package containing QT
Line 236... Line 237...
236
#
237
#
237
# Description     : This function will be invoked when a .QRC file
238
# Description     : This function will be invoked when a .QRC file
238
#                   is encountered in the Src directive
239
#                   is encountered in the Src directive
239
#
240
#
240
#                   .qrc file are QT resource files
241
#                   .qrc file are QT resource files
-
 
242
#                   There are two processing options
241
#                   These need to be processed into .cpp file
243
#                   Default : Proccess into a .cpp file
242
#                   and the .cpp file needs to be converted into an object file
244
#                             and then compiled into a .obj file
-
 
245
#                   --Binary : Process directly into a .rcc file
-
 
246
#                              These are loaded at runtime by the QT application
-
 
247
#                              Also made available via the global @RCC varaible to assist packaging          
243
#
248
#
244
# Inputs          : $path           - Source path
249
# Inputs          : $path           - Source path
245
#                   $path           - Source file name
250
#                   $path           - Source file name
246
#                   $obj            - Base file name (no dir or ext)
251
#                   $obj            - Base file name (no dir or ext)
247
#                   $ext            - Extension
252
#                   $ext            - Extension
Line 251... Line 256...
251
sub src_hook_qrc
256
sub src_hook_qrc
252
{
257
{
253
    Debug ("src_hook_qrc: @_");
258
    Debug ("src_hook_qrc: @_");
254
    my ( $srcfile ,$path, $obj, $ext ) = @_;
259
    my ( $srcfile ,$path, $obj, $ext ) = @_;
255
    my @dlist = ();
260
    my @dlist = ();
-
 
261
    my $csource;
-
 
262
    my $buildDirName;
-
 
263
    my $isBinary = ($SRC_ARGS{ $path } && grep (/^--Binary$/i, split( /$;/, $SRC_ARGS{$path} ) ) ) ? 1 : 0;
256
 
264
 
257
    #
265
    #
258
    #   The .qrc file will be converted into a cpp file
266
    #   The .qrc file will be converted into a cpp file
259
    #   Treat the .cpp file as a source file in its own right
267
    #   Treat the .cpp file as a source file in its own right
260
    #
268
    #
-
 
269
    if ($isBinary)
-
 
270
    {
-
 
271
        #
-
 
272
        #   Binary resource
-
 
273
        #   Treat it a bit like a program
-
 
274
        #       Put its name into an @RCC array to simplify packaging
-
 
275
        #       Tag it as a source file so that it can be packaged
-
 
276
        my $oName = $obj . '.rcc'; 
-
 
277
        $csource = '$(BINDIR)/' . $oName;
-
 
278
        $buildDirName = '$(GBE_BINDIR)';
-
 
279
        ToolsetGenerate($csource);
261
    $obj = 'qrc_' . $obj;
280
        push @RCC, $oName;
-
 
281
        Src ('*', $csource);
-
 
282
 
-
 
283
    } else {
-
 
284
        #
-
 
285
        #   Compiled resource
-
 
286
        #   Convert to a .cpp, which will then be made available
-
 
287
        #   Give the object a different name incase the user has a resource file and a
-
 
288
        #   program file of the same name.
-
 
289
        #   
262
    my $csource = '$(OBJDIR)/' . $obj . '.cpp' ;
290
        $csource = '$(OBJDIR)/' . $obj . '.cpp';
-
 
291
        $buildDirName = '$(GBE_OBJDIR)';
-
 
292
        $obj = 'qrc_' . $obj;
263
    GenerateSrcFile ( 1, $csource  );
293
        GenerateSrcFile ( 1, $csource  );
-
 
294
    }
264
 
295
 
265
    #
296
    #
266
    #   The user may have specified some dependencies
297
    #   The user may have specified some dependencies
267
    #   Create a list of these to be a part of the generated Rule
298
    #   Create a list of these to be a part of the generated Rule
268
    #
299
    #
Line 304... Line 335...
304
    #   Create a Rule to build this file
335
    #   Create a Rule to build this file
305
    #   Will be placed in the Rules section
336
    #   Will be placed in the Rules section
306
    #
337
    #
307
    my $var;
338
    my $var;
308
    my $me = MakeEntry::New (\$var, $csource );
339
    my $me = MakeEntry::New (\$var, $csource );
309
#    $me->AddComment ("QT Resource Compiler: $path" );
340
    $me->AddComment ("QT Resource Compiler: $path" );
310
    $me->AddDependancy ( $srcfile );
341
    $me->AddDependancy ( $srcfile );
311
    $me->AddDependancy ( @dlist );
342
    $me->AddDependancy ( @dlist );
312
    $me->AddDependancy ( '$(SCM_MAKEFILE)' );
343
    $me->AddDependancy ( '$(SCM_MAKEFILE)', $buildDirName );
-
 
344
    if ($isBinary) {
313
    $me->AddDependancy ( '$(GBE_OBJDIR)' );
345
        $me->AddRecipe     ( '$(XX_PRE)$(QT_RCCBIN)' );
-
 
346
    } else {
314
    $me->AddRecipe     ( '$(XX_PRE)$(QT_RCC)' );
347
        $me->AddRecipe     ( '$(XX_PRE)$(QT_RCC)' );
-
 
348
    }
315
    $me->Print();
349
    $me->Print();
316
 
350
 
317
    ToolsetRule ( $var );
351
    ToolsetRule ( $var );
318
}
352
}
319
 
353