⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qt.jam

📁 boost库提供标准的C++ API 配合dev c++使用,功能更加强大
💻 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 ;

# 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) ;
        
        feature.extend uses : qt ;
        #feature.action <uses>qt : add-properties ;            
        
        generators.register-standard qt.moc : H : CPP(moc_%) : <allow>qt ;    
        
        type.register UI : ui ;
        type.register UIC_H : : H ;
        
        generators.register-standard qt.uic-h : UI : UIC_H : <allow>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 : <allow>qt ;
            }
                        
            rule run ( project name ? : properties * : sources + :  multiple ? )
            {
                # Construct CPP as usual
                local result = [ generator.run $(project) $(name) 
                  : $(properties) : $(sources) : $(multiple) ] ;
                # If OK, add "UIC_H" target to the returned list
                if $(result)
                {
                    local action = [ $(result[1]).action ] ;
                    local sources = [ $(action).sources ] ;
                    result += $(sources[2]) ;
                }
            
                return $(result) ;
            }               
        }
    
        generators.register [ new qt::uic-cpp-generator ] ;
        
        # Finally, declare prebuilt target for QT library.
        local usage-requirements = 
             <include>$(.prefix)/include 
             <dll-path>$(.prefix)/lib
             <library-path>$(.prefix)/lib     
             <allow>qt
             ;  
        lib qt : : <name>qt-mt <threading>multi : : $(usage-requirements) ;
        lib qt : : <name>qt <threading>single : : $(usage-requirements) ;        
    }
}

# -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 $(<)
}

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

# 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 $(<)
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -