Skip to content

Commit

Permalink
Merge pull request #53 from OCR-D/check-pkg-config
Browse files Browse the repository at this point in the history
Add pkg-config checks to deps for magick++
  • Loading branch information
kba authored Jun 12, 2020
2 parents 3197092 + 9ce26be commit f2c9e36
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ deps-ubuntu:
git g++ make automake \
xmlstarlet ca-certificates libmagick++-dev libgraphicsmagick++1-dev libboost-dev

check_pkg_config = \
if ! pkg-config --modversion $(1) >/dev/null 2>/dev/null;then\
echo "$(1) not installed. 'make deps-ubuntu' or 'sudo apt install $(2)'"; exit 1 ;\
fi

check_config_status = \
if test "$(3)" = "alternative";then predicate='["HAVE_$(1)_TRUE"]="\#"' ;\
else predicate='["HAVE_$(1)"]=" 1"'; fi;\
if ! grep -Fq "$$predicate" $(BUILD_DIR)/config.status;then \
echo "$(2) not installed. 'make deps-ubuntu' or 'sudo apt install $(2)'"; \
exit 1 ; \
fi;

deps-check:
$(call check_pkg_config,Magick++,libmagick++-dev)
$(call check_pkg_config,ImageMagick++,libgraphicsmagick++-dev)
$(call check_config_status,BOOST,libboost-dev)

deps: #deps-ubuntu
test -x $(BINDIR)/scribo-cli && \
$(BINDIR)/scribo-cli sauvola --help >/dev/null 2>&1 || \
Expand Down Expand Up @@ -93,6 +111,7 @@ $(BUILD_DIR)/config.status: $(OLENA_DIR)/configure
--with-qt=no \
--with-tesseract=no \
--enable-scribo SCRIBO_CXXFLAGS="-DNDEBUG -DSCRIBO_NDEBUG -O2"
$(MAKE) deps-check

build-olena: $(BUILD_DIR)/config.status
cd $(OLENA_DIR)/milena/mln && touch -r version.hh.in version.hh
Expand Down

0 comments on commit f2c9e36

Please sign in to comment.