SubDir TOP apps tools cslight ;

Description cslight : "Lighting Calculator" ;
ApplicationIcon win32 : cslight : cslight.ico ;
Application cslight : [ Wildcard *.cpp *.h ] ;
LinkWith cslight : crystalspace ;
FileListEntryApplications cslight : app-tool ;

if [ Property build : projgen_version ] != 6
{

Description cslight_static : "Lighting Calculator (static build)" ;

SubVariant static ;

ApplicationIcon win32 : cslight_static : lighter.ico ;
Application cslight_static : [ Wildcard *.cpp *.h ] :
  console independent noinstall nohelp ;
CFlags cslight_static : [ FDefines CS_STATIC_LINKED ] ;
LinkWith cslight_static : crystalspace ;

CSLIGHT.PLUGINLIST =
  bezier
  bezierldr
  csbmpimg
  csddsimg
  csgifimg
  csopcode
  csparser
  cssynldr
  dsplex
  dynavis
  particles
  particlesldr
  ptpdlight
  emit
  emitldr
  engine
  engseq
  frustvis
  genmesh
  gmeshanim
  gmeshldr
  gmeshskelanim2
  skeleton
  skelldr
  vproc_std
  haze
  hazeldr
  imgplex
  null2d
  null3d
  nullmesh
  protomesh
  protomeshldr
  rendloop_loader
  rendstep_std
  rendstep_stencil
  reporter
  sequence
  shadermgr
  shaderweaver
  simpleformer
  simpleformerldr
  sndmanager
  sndsysnull
  soft3d
  spr2d
  spr2dldr
  spr3d
  spr3dldr
  stdpt
  stdrep
  bruteblock
  terrainldr
  thing
  thingldr
  xmlread
  xmlshader
  ;

if $(ZLIB.AVAILABLE) = "yes"
{
  CSLIGHT.PLUGINLIST += vfs ;
}
if $(JPEG.AVAILABLE) = "yes"
{
  CSLIGHT.PLUGINLIST += csjpgimg ;
}
if $(PNG.AVAILABLE) = "yes"
{
  CSLIGHT.PLUGINLIST += cspngimg ;
}
if $(CAL3D.AVAILABLE) = "yes"
{
  ;CSLIGHT.PLUGINLIST += sprcal3d sprcal3dldr ;
}

# Plugins needed by both software & GL renderers
if $(X11.AVAILABLE) = "yes"
{
  CSLIGHT.PLUGINLIST += xwin xextshm ;
  if $(XFREE86VM.AVAILABLE) = "yes" { CSLIGHT.PLUGINLIST += xext86vm ; }
}

if $(GL.AVAILABLE) = "yes"
{
  CSLIGHT.PLUGINLIST += gl3d glshader_arb glshader_fixed ;

  # GL canvases
  if $(GLX.AVAILABLE) = "yes" { CSLIGHT.PLUGINLIST += glx2d ; }
  if $(TARGET.OS) = "WIN32" { CSLIGHT.PLUGINLIST += glwin32 ; }
  if $(TARGET.OS) = "MACOS_X" { CSLIGHT.PLUGINLIST += glosx2d ; }

  if $(CG.AVAILABLE) = "yes" { CSLIGHT.PLUGINLIST += glshader_cg ; }
}

CSLIGHT.PLUGINLIST += softshader ;

# Software canvases.
if $(X11.AVAILABLE) = "yes" { CSLIGHT.PLUGINLIST += x2d ; }
if $(DIRECTX.AVAILABLE) = "yes" { CSLIGHT.PLUGINLIST += ddraw2d ; }
if $(TARGET.OS) = "MACOS_X" { CSLIGHT.PLUGINLIST += cgdriver2d ; }

LinkStaticPlugins cslight_static : $(CSLIGHT.PLUGINLIST) ;
FileListEntryApplications cslight_static : app-tool-static ;
SubVariant ;
}

