diff --git a/.gitignore b/.gitignore index 03f2482..f698d35 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ src/test.sp* src/*.log src/*.trs - +build/ diff --git a/.travis.yml b/.travis.yml index 6786805..a9bd1eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,5 @@ before_install: - sudo apt-get update -qq - sudo apt-get install -qq libsnappy-dev -script: autoreconf --install && ./configure && make && make check +script: + - mkdir build && cd build && cmake .. && make diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4bca20b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,12 @@ +project (sparkey) +cmake_minimum_required (VERSION 2.7) + +add_subdirectory (src) + +find_package (Doxygen) +if (DOXYGEN_FOUND) + add_custom_target (doc + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Running Doxygen" VERBATIM) +endif () diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index e7964b5..0000000 --- a/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -SUBDIRS = src -dist_doc_DATA = README.md - -if HAVE_DOXYGEN - -doxyfile.stamp: - $(DOXYGEN) Doxyfile - echo Timestamp > doxyfile.stamp - -CLEANFILES = doxyfile.stamp -all-local: doxyfile.stamp -clean-local: - rm -rf doxy - -endif diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 213df7e..0000000 --- a/configure.ac +++ /dev/null @@ -1,32 +0,0 @@ -AC_INIT([libsparkey], [0.1.0], [krka@spotify.com], [sparkey]) -AM_INIT_AUTOMAKE([-Werror foreign]) -LT_INIT -AC_PROG_CC_C99 - -AC_CHECK_PROGS([DOXYGEN],[doxygen]) -if test -z "$DOXYGEN"; - then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) -fi - -AM_CONDITIONAL([HAVE_DOXYGEN], - [test -n "$DOXYGEN"]) - AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([Doxyfile]) -]) - - - -AC_SEARCH_LIBS([snappy_compress], - [snappy],,[AC_MSG_ERROR([Could not find snappy]) -]) - -AM_CONDITIONAL([NOT_APPLE], [test x$build_vendor != xapple]) -AM_COND_IF([NOT_APPLE], [ - AC_SEARCH_LIBS([clock_gettime], - [rt],,[AC_MSG_ERROR([Could not find rt]) - ]) -]) -AC_CONFIG_FILES([ - Makefile - src/Makefile -]) -AC_OUTPUT diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..90e7b91 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,15 @@ +set (SRC + buf.c hashalgorithms.c hashiter.c hashwriter.c + logreader.c returncodes.c util.c endiantools.c + hashheader.c hashreader.c logheader.c logwriter.c MurmurHash3.c) + +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -Wfloat-equal -Wshadow -Wpointer-arith -Werror -pedantic -std=c99") + +add_library (sparkey ${SRC}) +add_executable (sparkey-cli ${SRC} main.c) +add_executable (sparkey-bench ${SRC} bench.c) + +set_target_properties (sparkey-cli PROPERTIES OUTPUT_NAME sparkey) + +target_link_libraries (sparkey-cli snappy) +target_link_libraries (sparkey-bench snappy)