Sha256: 5419278d99b145e603f73e1706eb7057a8e6261cba496f759ac470b4783c0099

Contents?: true

Size: 1.98 KB

Versions: 5

Compression:

Stored size: 1.98 KB

Contents

require 'build-tool/build-system/make'

module BuildTool; module BuildSystem


    #
    #
    #
    class Qt < Base

        include MJ::Tools::SubProcess

        class QMakeError < BuildTool::Error; end

        def intitialize( *args )
            super( *args )
        end

        #
        ### ATTRIBUTES
        #

        # Check if the module is configured
        def configured?
            Pathname.new( build_directory ).join( 'Makefile' ).exist?
        end

        def name
            "qt"
        end

        #
        ### METHODS
        #

        # Execute a cmake command in the context of the build directory
        def _configure( command, wd = build_directory )
            rc = self.class.execute "#{source_directory}/configure #{command}", wd, env
            if rc != 0
                raise QMakeError, "configure failed with error #{rc}!"
            end
            rc
        end

        def after_rebase
            if configured?
                logger.info "Running bin/syncqt"
                rc = self.class.execute( "bin/syncqt", build_directory, self.module.environment.values )
            end
        end

        def configure
            check_build_directory( true )
            opt = ""
            opt += " -prefix #{install_prefix.to_s} " if install_prefix
            opt += self['flags']
            rc = _configure opt
            rc
        end

        def install( fast )
            make( "install" )
        end

        def install_fast_supported?
            true
        end

        def make( target = nil )
            Make.make( "#{target ? target : "" }", build_directory, self.module.environment.values )
        end

        # Configure the module
        def reconfigure()
            if File.exist?( "#{build_directory}/.qmake.cache" )
                return false if self.class.execute( "rm -f #{build_directory}/.qmake.cache" ) != 0
            end
            configure
        end

    end # class Autoconf

end; end # module BuildTool::BuildSystem

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
build-tool-0.5.7 lib/build-tool/build-system/qt.rb
build-tool-0.5.6 lib/build-tool/build-system/qt.rb
build-tool-0.5.5 lib/build-tool/build-system/qt.rb
build-tool-0.5.4 lib/build-tool/build-system/qt.rb
build-tool-0.5.3 lib/build-tool/build-system/qt.rb