Skip to content

Commit

Permalink
BUILD: Support cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Wielemaker authored and Jan Wielemaker committed Sep 22, 2018
1 parent d871bff commit d16cefa
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ configure
zlib.tex
zlib.html
zlib.pdf
test_multipart.gz
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 2.8.12)
project(swipl-zlib)

include("../cmake/PrologPackage.cmake")

find_package(ZLIB)
if(ZLIB_FOUND)

swipl_plugin(
zlib4pl
C_SOURCES zlib4pl.c
C_LIBS ${ZLIB_LIBRARIES}
PL_LIBS zlib.pl)
target_include_directories(
plugin_zlib4pl BEFORE PRIVATE
${ZLIB_INCLUDE_DIR})

test_libs(
zlib
PACKAGES clib plunit)

pkg_doc(zlib)

endif(ZLIB_FOUND)
7 changes: 1 addition & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ uninstall::
# Testing
################################################################

check: test_multipart.gz
check::
$(PL) -q -f test_zlib.pl -g test_zlib -t halt

test_multipart.gz:
echo "Part1" | gzip > $@
echo "Part2" | gzip >> $@


################################################################
# Clean
Expand All @@ -78,6 +74,5 @@ clean:
distclean: clean
rm -f $(TARGETS) config.cache config.h config.status Makefile
rm -f $(DOC).aux $(DOC).log $(DOC).out $(DOC).toc
rm -f test_multipart.gz
rm -rf html
rm -rf autom4te.cache
Binary file added test_multipart.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion zlib4pl.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/

#define O_DEBUG 1
#include <config.h>
#define PL_ARITY_AS_SIZE
#include <SWI-Stream.h>
#include <SWI-Prolog.h>
#include <stdlib.h>
Expand Down

0 comments on commit d16cefa

Please sign in to comment.