From 8bd894275a2c6c92e538448b309d4f8c68a08bf2 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Thu, 1 Dec 2011 01:59:38 +0000 Subject: [PATCH] Added flag to install matlab tests into toolbox path --- configure.ac | 11 +++++++++++ wrap/Makefile.am | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6b057ba46..b1dc2fc06 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,17 @@ AC_ARG_ENABLE([build_toolbox], AM_CONDITIONAL([ENABLE_BUILD_TOOLBOX], [test x$build_toolbox = xtrue]) +# enable installation of matlab tests +AC_ARG_ENABLE([install_matlab_tests], + [ --enable-install-matlab-tests Enable installation of tests for the Matlab toolbox], + [case "${enableval}" in + yes) install_matlab_tests=true ;; + no) install_matlab_tests=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-install-matlab-tests]) ;; + esac],[install_matlab_tests=true]) + +AM_CONDITIONAL([ENABLE_INSTALL_MATLAB_TESTS], [test x$install_matlab_tests = xtrue]) + # Matlab toolbox: optional flag to change location of toolbox, defaults to install prefix AC_ARG_WITH([toolbox], [AS_HELP_STRING([--with-toolbox], diff --git a/wrap/Makefile.am b/wrap/Makefile.am index 895830537..c32a9cc5f 100644 --- a/wrap/Makefile.am +++ b/wrap/Makefile.am @@ -57,9 +57,17 @@ all: ./wrap ${interfacePath} ${moduleName} ${toolboxpath} ${nameSpace} ${mexFlags} # install the headers and matlab toolbox +if ENABLE_INSTALL_MATLAB_TESTS install-exec-hook: all install -d ${toolbox}/gtsam && \ - cp -rf ../toolbox/* ${toolbox}/gtsam + cp -rf ../toolbox/* ${toolbox}/gtsam && \ + mkdir -p ${toolbox}/gtsam/tests && \ + cp -rf ../../tests/matlab/*.m ${toolbox}/gtsam/tests +else +install-exec-hook: all + install -d ${toolbox}/gtsam && \ + cp -rf ../toolbox/* ${toolbox}/gtsam/tests +endif # clean local toolbox dir clean: