<!DOCTYPE module SYSTEM "module.dtd">

<module name="fdm_jsbsim" dir="fdm">
  <doc>
    <description>
      JSBSim FDM backend for NPS simulator

      Use the paparazzi-jsbsim package if it is installed, otherwise look for JSBsim under /opt/jsbsim

      JSBSim doc: http://wiki.paparazziuav.org/wiki/JSBSim
      NPS doc: http://wiki.paparazziuav.org/wiki/NPS
    </description>
    <configure name="FIND_JSBSIM_VIA_PKG_CONFIG" value="yes|no" description="enable or disable using pkg-config to get library flags (enabled by default when package exists)"/>
    <configure name="JSBSIM_ROOT" value="/opt/jsbsim" description="set root directory for JSBSim library when auto-detection (see FIND_JSBSIM_VIA_PKG_CONFIG) is not used (default path: /opt/jsbsim)"/>
  </doc>
  <header/>
  <makefile target="nps|hitl">
    <configure name="JSBSIM_ROOT" default="/opt/jsbsim"/>
    <configure name="JSBSIM_INC" value="$(JSBSIM_ROOT)/include/JSBSim"/>
    <configure name="JSBSIM_LIB" value="$(JSBSIM_ROOT)/lib"/>
    <configure name="FIND_JSBSIM_VIA_PKG_CONFIG" default="$(shell pkg-config JSBSim --exists && echo 'yes')"/>
    <raw>
      ifeq ($(FIND_JSBSIM_VIA_PKG_CONFIG), yes)
      nps.CFLAGS  += $(shell pkg-config JSBSim --cflags)
      nps.LDFLAGS += $(shell pkg-config JSBSim --libs)
      else
      FIND_JSBSIM_VIA_PKG_CONFIG = no
      nps.CFLAGS  += -I$(JSBSIM_INC)
      nps.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
      endif
    </raw>
    <file name="nps_fdm_jsbsim.cpp" dir="nps"/>
  </makefile>
</module>

