Files
harbour-core/harbour/utils/hbmk2/examples/plug_tpl.prg
Viktor Szakats 78742ae944 2010-06-03 10:43 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* harbour-win-spec
  * src/pp/hbpp.c
  * src/compiler/hbusage.c
  * doc/class_tp.txt
  * doc/howtobld.txt
  * doc/howtosvn.txt
  * doc/hdr_tpl.txt
  * doc/readme.txt
  * doc/whatsnew.txt
  * harbour-wce-spec
  * INSTALL
  * harbour.spec
  * utils/hbformat/hbformat.prg
  * utils/hbmk2/examples/plug_tpl.prg
  * utils/hbi18n/hbi18n.prg
  * utils/hbtest/hbtest.prg
  * utils/hbrun/hbrun.prg
  * config/global.mk
    * Deleted 'www.' from harbour-project.org website name.
      (www.harbour-project.org -> harbour-project.org)

  * contrib/xhb/xhbarr.c
    + Added TOFIX for AREMOVE() which should better be moved
      to hbxpp lib (possibly after deleting the xhb extension from
      that implementation).

  * package/winuni/RELNOTES
    + Added 'harbour-project.org'
2010-06-03 08:43:47 +00:00

72 lines
2.2 KiB
Plaintext

/*
* $Id$
*/
/*
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*
* See COPYING for licensing terms.
*/
FUNCTION hbmk2_plugin_tpl( hbmk2 )
LOCAL cMOC_BIN
LOCAL tmp
SWITCH hbmk2[ "cSTATE" ]
CASE "pre_all"
FOR EACH tmp IN hbmk2[ "params" ]
hbmk2_OutStd( hbmk2, hb_StrFormat( "Parameter #%1$s: '%2$s'", hb_ntos( tmp:__enumIndex() ), tmp ) )
NEXT
hbmk2_AddInput_C( hbmk2, "hello.c" )
EXIT
CASE "pre_c"
cMOC_BIN := GetEnv( "MOC_BIN" )
IF Empty( cMOC_BIN )
IF Empty( GetEnv( "HB_QT_MOC_BIN" ) )
IF hbmk2[ "cPLAT" ] == "win"
cMOC_BIN := GetEnv( "HB_WITH_QT" ) + "\..\bin\moc.exe"
IF ! hb_FileExists( cMOC_BIN )
hbmk2_OutErr( hbmk2, "HB_WITH_QT points to incomplete QT installation. moc executable not found." )
RETURN NIL
ENDIF
ELSE
cMOC_BIN := hbmk2_FindInPath( "moc", "/opt/qtsdk/qt/bin" )
IF Empty( cMOC_BIN )
cMOC_BIN := hbmk2_FindInPath( "moc", "/opt/qtsdk/qt/bin" )
IF Empty( cMOC_BIN )
hbmk2_OutErr( hbmk2, "HB_QT_MOC_BIN not set, could not autodetect" )
RETURN NIL
ENDIF
ENDIF
ENDIF
hbmk2_OutStd( hbmk2, "Using QT 'moc' executable: " + cMOC_BIN + " (autodetected)" )
ELSE
IF hb_FileExists( GetEnv( "HB_QT_MOC_BIN" ) )
cMOC_BIN := GetEnv( "HB_QT_MOC_BIN" )
hbmk2_OutStd( hbmk2, "Using QT 'moc' executable: " + cMOC_BIN )
ELSE
hbmk2_OutErr( hbmk2, "HB_QT_MOC_BIN points to non-existent file. Make sure to set it to full path and filename of moc executable." )
RETURN NIL
ENDIF
ENDIF
ENDIF
hbmk2[ "vars" ][ "MOC_BIN" ] := cMOC_BIN
EXIT
CASE "post_all"
hbmk2_OutStd( hbmk2, "POST_ALL: " + hbmk2[ "vars" ][ "MOC_BIN" ] )
OTHERWISE
IF hbmk2[ "lTRACE" ]
hbmk2_OutStd( hbmk2, "@@ Entered plugin: " + hbmk2[ "cSTATE" ] )
ENDIF
ENDSWITCH
RETURN NIL