cd ${SOURCE_DIRECTORY}  &&

mkdir -p ${INSTALL_ROOT}/usr/include/${SPELL}  &&

install CImg.h ${INSTALL_ROOT}/usr/include/${SPELL}  &&

if [[ "${CIMG_PLUGINS}" == "y" ]]
then
  mv plugins/README.txt README_PLUGINS.txt  &&
  cp -r plugins ${INSTALL_ROOT}/usr/include/${SPELL}
fi  &&

if [[ "${CIMG_EXAMPLES}" == "y" ]]
then
  mkdir -p ${INSTALL_ROOT}/usr/share/doc/${SPELL}/examples/bin  &&
  cd ${SOURCE_DIRECTORY}/examples  &&
  cp -R img ${INSTALL_ROOT}/usr/share/doc/${SPELL}/examples/bin  &&
  for  file in CImg_demo dtmri_view fade_images greycstoration \
greycstoration4integration hough_transform image_registration image2ascii \
image_surface mcf_levelsets mcf_levelsets3D nlmeans odykill pslider \
pde_heatflow2D pde_TschumperleDeriche2D tetris tutorial wavelet_atrous inrcast
  do
    install ${file} ${INSTALL_ROOT}/usr/share/doc/${SPELL}/examples/bin  &&
    install ${file}.cpp ${INSTALL_ROOT}/usr/share/doc/${SPELL}/examples
  done 
fi
