# Create a library called "bdm" which includes sources from all subdirectories

SET(bdm_base base/bdmbase.cpp base/bdmbase.h base/datasources.cpp base/datasources.h base/loggers.cpp base/loggers.h)
SET(bdm_math math/square_mat.cpp math/square_mat.h 
	math/chmat.cpp math/chmat.h 
	math/functions.cpp math/functions.h)
SET(bdm_stat stat/exp_family.cpp stat/exp_family.h stat/emix.cpp stat/emix.h stat/merger.h stat/merger.cpp stat/discrete.h stat/discrete.cpp)
SET(bdm_estim estim/kalman.cpp estim/kalman.h estim/particles.cpp estim/particles.h estim/arx.cpp estim/arx.h estim/arx_straux.cpp estim/mixtures.cpp estim/mixtures.h)
SET(bdm_ctrl design/ctrlbase.cpp design/ctrlbase.h)
SET(bdm_user_info base/libconfig/lib/libconfigcpp.cc base/libconfig/lib/grammar.c base/libconfig/lib/libconfig.c 
	base/libconfig/lib/libconfig.h base/libconfig/lib/libconfig.hh base/libconfig/lib/scanner.c  base/user_info.cpp base/user_info.h  base/libconfig/lib/parsectx.h base/libconfig/lib/scanctx.c base/libconfig/lib/scanctx.h  base/libconfig/lib/strbuf.h 
base/libconfig/lib/strbuf.c)

SET(bdm_mex mex/mex_datasource.h mex/mex_parser.h mex/mex_logger.h  )

SET(bdm_support bdmerror.cpp bdmerror.h bdmroot.cpp bdmroot.h itpp_ext.cpp itpp_ext.h osutils.cpp osutils.h shared_ptr.h)

IF(WIN32)
   SET(bdm_support ${bdm_support} dirent.c dirent.h)
ENDIF()

# add BDMLIB compile flag
ADD_DEFINITIONS(-DBDMLIB)

# Normal BDM library
add_library (bdm STATIC ${bdm_support} ${bdm_base} ${bdm_math} ${bdm_stat} ${bdm_estim} ${bdm_ctrl} ${bdm_mex} ${bdm_user_info})
