build: add cmake support

feat: add cmake support

chore: remove old code

revert: remove mbus_data_record_unit

build: do not break existing building system
This commit is contained in:
Carlos Gomes Martinho
2020-03-17 21:25:08 +01:00
parent 62ac3678ff
commit d96dcfad09
8 changed files with 279 additions and 21 deletions

View File

@ -1,21 +1,7 @@
#!/bin/sh
#
if [ -f Makefile ]; then
# use existing automake files
echo >> /dev/null
else
# regenerate automake files
echo "Running autotools..."
autoheader \
&& aclocal \
&& case \
$(uname) in Darwin*) glibtoolize --ltdl --copy --force ;; \
*) libtoolize --ltdl --copy --force ;; esac \
&& automake --add-missing --copy \
&& autoconf \
&& ./configure
fi
make
rm -rf _build
mkdir _build
cd _build
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON
cmake --build .