
bin_PROGRAMS = xmunipack

xmunipack_SOURCES = xmunipack.cpp fits.cpp fitsimage.cpp itt.cpp color.cpp \
       palette.cpp fitsmeta.cpp browser.cpp log.cpp list.cpp fileprop.cpp \
       view.cpp config.cpp averages.cpp display.cpp discanvas.cpp dispanel.cpp \
       corrections.cpp time.cpp value.cpp grid.cpp tune.cpp detail.cpp \
       event.cpp head.cpp icon.cpp help.cpp collector.cpp \
       archive.cpp thumbnail.cpp fitscoo.cpp zoom.cpp dataobj.cpp \
       coloring.cpp plot.cpp listwin.cpp rawimport.cpp cone.cpp \
       search.cpp preferences.cpp resume.cpp calibrate.cpp selectsrc.cpp \
       astrometry.cpp astropt.cpp astrolog.cpp \
       astrometer.cpp photometry.cpp

if BUNDLE
  iconsdir = $(prefix)/share/icons
  xdgicondir = $(prefix)/share/icons/hicolor/48x48/apps
  desktopdir = $(prefix)/share/munipack
  FLAGS= -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/html\"
else
  iconsdir = $(datarootdir)/pixmaps/munipack
  xdgicondir = $(datarootdir)/icons/hicolor/48x48/apps
  desktopdir = $(datarootdir)/applications
  FLAGS= -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 $(FLAGS) -I../wxMathPlot $(WX_CPPFLAGS)

xmunipack_LDADD = -L$(top_srcdir)/munipack -L../lib -L../vo -L../wxMathPlot -lvocatconf -lvotable -lmprocess -lwxMathPlot $(WX_LIBS) -lmfitsio -lcfitsio @LIBGCC@ @LIBSTDCPP@ -lm

man_MANS = xmunipack.1

include image_list.mk
icons_DATA = $(image_list)

desktop_DATA = xmunipack.desktop
xdgicon_DATA = xmunipack.png

#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
