Changeset 28


Ignore:
Timestamp:
Jun 11, 2009, 8:11:16 PM (11 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: Create mkspecs/default.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r26 r28  
    652652    /* mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't
    653653     * be set once configured */
    654 /*
    655 @todo
    656 */
     654    call DeleteDir G.RelPath"\mkspecs\default"
     655    call CopyDir G.RelPath"\mkspecs\"G.PLATFORM, G.RelPath"\mkspecs\default"
     656    /* fix qmake.conf by appending the location of the original to it; this is
     657     * used by qmake/project.cpp to determine the original QMAKESPEC */
     658    call charout G.RelPath"\mkspecs\default\qmake.conf",,
     659        G.EOL"QMAKESPEC_ORIGINAL="G.RelPath"\mkspecs\"G.PLATFORM||G.EOL
     660    call charout G.RelPath"\mkspecs\default\qmake.conf"
    657661
    658662    /* create temporary qconfig.h for compiling qmake, if it doesn't exist
     
    697701        call Done 2
    698702
     703    /* @todo not everything implemented yet, cry loudly... */
    699704    signal Nonsense
    700705    return
     
    785790MakeDir: procedure expose (Globals)
    786791    /* @todo teach it to create all non-existing intermediate dirs */
    787     parse arg path
    788     rc = SysMkDir(path)
     792    parse arg aDir
     793    rc = SysMkDir(aDir)
    789794    if (rc \= 0) then do
    790         call SayErr 'FATAL: Could not create directory '''path'''!'
     795        call SayErr 'FATAL: Could not create directory '''aDir'''!'
    791796        call SayErr 'SysMkDir returned 'rc
    792797        call Done 1
     798    end
     799    return
     800
     801CopyDir: procedure expose (Globals)
     802    parse arg aDirFrom, aDirTo
     803    address 'cmd' 'xcopy',
     804        FixDirNoSlash(aDirFrom) FixDirNoSlash(aDirTo)'\ /s /e 1>nul 2>nul'
     805    if (rc \== 0) then do
     806        call SayErr 'FATAL: Could not copy '''aDirFrom''' to '''aDirTo'''!'
     807        call SayErr 'xcopy returned 'rc
     808        call Done 1
     809    end
     810    return
     811
     812/**
     813 * Removes the given directory @aDir and all its contents, recursively. If @a
     814 * aMask is not empty, then only files matching this mask are recursively
     815 * deleted in the given directory tree, but not the directories themselves.
     816 *
     817 * @param aDir    Directory to remove.
     818 * @param aMask   Mask of files to remove.
     819 */
     820DeleteDir: procedure expose (Globals)
     821    parse arg aDir, aMask
     822    call SysFileTree aDir'\*', 'dirs.', 'DO'
     823    call SysFileTree aDir'\'aMask, 'files.', 'FO'
     824    do i = 1 to files.0
     825        rc = SysFileDelete(files.i)
     826        if (rc \= 0) then do
     827            call SayErr 'FATAL: Could not remove file '''files.i'''!'
     828            call SayErr 'SysFileDelete returned 'rc
     829            call Done 1
     830        end
     831    end
     832    do i = 1 to dirs.0
     833        call RemoveDir dirs.i, aMask
     834    end
     835    if (aMask == '') then do
     836        rc = SysRmDir(aDir)
     837        if (rc \= 0 & rc \= 2) then do
     838            call SayErr 'FATAL: Could not remove directory '''aDir'''!'
     839            call SayErr 'SysRmDir returned 'rc
     840            call Done 1
     841        end
    793842    end
    794843    return
  • trunk/qmake/project.cpp

    r27 r28  
    16681668                                             : vars["QMAKESPEC_ORIGINAL"]);
    16691669        if (!spec_org.isEmpty()) {
    1670             spec = spec_org.at(0);
    1671             int lastSlash = spec.lastIndexOf('/');
    1672             if(lastSlash != -1)
    1673                 spec = spec.mid(lastSlash + 1);
     1670            spec = QFileInfo(spec_org.at(0)).fileName();
    16741671            if((regex && re.exactMatch(spec)) || (!regex && spec == x))
    16751672                return true;
Note: See TracChangeset for help on using the changeset viewer.