From 946ee4bc4a0bc13a965d170ab959cfe7a2cf1b27 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 26 Jun 2018 11:53:44 +0200 Subject: Embed diffraction.cl and hdfsee.ui into executables Having to install these causes problems, e.g. you can't run from build directory nor run tests without installing. For hdfsee.ui, the XML is now embedded in the code just as it is for cell_explorer. diffraction.cl is a bit too long and complicated for that. There are a number of nasty ways to embed such files. This one seems to be the overall least nasty, although it requires data/gen-resources to be run whenever diffraction.cl is changed. --- data/gen-resources | 20 ++++++++++++++++++++ data/hdfsee.ui | 53 ----------------------------------------------------- 2 files changed, 20 insertions(+), 53 deletions(-) create mode 100755 data/gen-resources delete mode 100644 data/hdfsee.ui (limited to 'data') diff --git a/data/gen-resources b/data/gen-resources new file mode 100755 index 00000000..273f7db7 --- /dev/null +++ b/data/gen-resources @@ -0,0 +1,20 @@ +#!/bin/sh + +function gen_resource() +{ + INFILE=$1 + OUTFILE=$2 + + echo "/*" > $OUTFILE + echo " * This file was generated from $INFILE" >> $OUTFILE + echo " * using the following command:" >> $OUTFILE + echo " * xxd -i $INFILE $OUTFILE" >> $OUTFILE + echo " *" >> $OUTFILE + echo " * If you have 'xxd' installed, you can run the script" >> $OUTFILE + echo " * data/gen-resources to re-create this file." >> $OUTFILE + echo " */" >> $OUTFILE + echo >> $OUTFILE + xxd -i $INFILE >> $OUTFILE +} + +gen_resource data/diffraction.cl src/diffraction.cl.h diff --git a/data/hdfsee.ui b/data/hdfsee.ui deleted file mode 100644 index 9294d932..00000000 --- a/data/hdfsee.ui +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3