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: