
bin_PROGRAMS = xmunipack

xmunipack_SOURCES = xmunipack.cpp fits.cpp itt.cpp fitscolour.cpp \
       palette.cpp fitsmeta.cpp browser.cpp list.cpp navigation.cpp \
       dirscan.cpp metarender.cpp fileprop.cpp render.cpp \
       splashing.cpp extlist.cpp view.cpp config.cpp dummy.cpp \
       display.cpp fitsstream.cpp \
       time.cpp value.cpp grid.cpp \
       tune.cpp tuner.cpp export.cpp \
       fitsdisplay.cpp legend.cpp \
       fitsgeometry.cpp fitshisto.cpp fitsstat.cpp fitstone.cpp ecdf.cpp \
       fitsarray.cpp fitstable.cpp event.cpp head.cpp icon.cpp help.cpp \
       fitscoo.cpp \
       plplot.cpp rawimport.cpp cone.cpp \
       preferences.cpp calibrate.cpp selectsrc.cpp \
       find.cpp findplot.cpp astrometry.cpp astropt.cpp astrolog.cpp \
       astrometer.cpp thumbcanvas.cpp mtool.cpp \
       human.cpp aphotaper.cpp aphotdisplay.cpp aphot.cpp \
       starlayer.cpp caption.cpp dismag.cpp dispreview.cpp zoomer.cpp zoomset.cpp \
       articons.cpp

#log.cpp photometry.cpp

if BUNDLE
  iconsdir = $(prefix)/share/icons
  xdgicondir = $(prefix)/share/icons/hicolor/128x128/apps
  desktopdir = $(prefix)/share/munipack
  metadir = $(prefix)/share/metainfo
  XFLAGS= -DMUNIPACK_LIBEXEC_DIR=\"$(BUNDLEDIR)/libexec/munipack\"      \
          -DMUNIPACK_DATA_DIR=\"$(BUNDLEDIR)/share/munipack\"           \
          -DMUNIPACK_ICON_DIR=\"$(BUNDLEDIR)/share/icons\"           \
          -DMUNIPACK_DOC_DIR=\"$(BUNDLEDIR)/share/doc/munipack\"        \
          -DMUNIPACK_HTML_DIR=\"$(BUNDLEDIR)/share/doc/munipack\"
else
  iconsdir = $(datarootdir)/pixmaps/munipack
  xdgicondir = $(datarootdir)/icons/hicolor/128x128/apps
  desktopdir = $(datarootdir)/applications
  metadir = $(datarootdir)/metainfo
  XFLAGS= -DMUNIPACK_LIBEXEC_DIR=\"$(pkglibexecdir)\"            \
          -DMUNIPACK_DATA_DIR=\"$(pkgdatadir)\"                  \
          -DMUNIPACK_ICON_DIR=\"$(iconsdir)\"                    \
          -DMUNIPACK_DOC_DIR=\"$(docdir)\"                       \
          -DMUNIPACK_HTML_DIR=\"$(htmldir)\"
endif

xmunipack_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/wxMathPlot \
                     $(WX_CXXFLAGS_GUI) $(PLplot_CFLAGS) $(XFLAGS)
xmunipack_LDFLAGS = @LIBGCC@ @LIBSTDCPP@
xmunipack_LDADD = $(top_srcdir)/wxMathPlot/libwxMathPlot.a \
                  $(top_srcdir)/munipack/libmprocess.a \
                  $(top_srcdir)/vo/libvocatconf.a \
                  $(top_srcdir)/vo/libvotable.a \
                  $(top_srcdir)/lib/libmfitsio.a \
                  $(PLplot_LIBS) $(WX_LIBS_GUI) $(LIBCFITSIO) $(LIBM)

man_MANS = xmunipack.1

include image_list.mk
icons_DATA = $(image_list)

desktop_DATA = xmunipack.desktop
xdgicon_DATA = icons/munipack_icon.png

meta_DATA = cz.muni.physics.munipack.xmunipack.metainfo.xml

#Xmunipack.app: Info.plist xmunipack
#	-mkdir -p Xmunipack.app
#	-mkdir -p Xmunipack.app/Contents
#	-mkdir -p Xmunipack.app/Contents/MacOS
#	-mkdir -p Xmunipack.app/Contents/Resources
#	cp Info.plist Xmunipack.app/Contents/
#	echo -n 'APPL????' > Xmunipack.app/Contents/PkgInfo
#	cp xmunipack Xmunipack.app/Contents/MacOS/
#	cp icons/munipack_icon.png Xmunipack.app/Contents/Resources/Xmunipack.png
