Legoktm has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/386766 )
Change subject: Add support for OpenCV 3.0+ with autotools
..
Add support for OpenCV 3.0+ with autotools
OpenCV 3.0 split parts of the highgui module into imgcodecs, requiring
an extra module to be linked.
Use autoconf and automake to see if the new module exists, and link to
it if so. The new build instructions are similar, just require running
autoreconf and ./configure before make.
Signed-off-by: Antoine Musso
Change-Id: Iad0c2e869f06e3a880a994f863f46359a877c240
---
M .gitignore
D Makefile
A Makefile.am
M README.md
A configure.ac
5 files changed, 63 insertions(+), 24 deletions(-)
Approvals:
Tim Starling: Looks good to me, approved
Legoktm: Verified
diff --git a/.gitignore b/.gitignore
index 302f31b..dc3a677 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,16 @@
/uprightdiff
/test
+*.o
+*.log
+
+/.deps
+/Makefile
+/Makefile.in
+/aclocal.m4
+/autom4te.cache
+/compile
+/config.status
+/configure
+/depcomp
+/install-sh
+/missing
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 0d0428c..000
--- a/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CFLAGS +=-g -std=c++11 -Wall -O2
-PREFIX=/usr
-
-all: uprightdiff test
-
-install: all
- install -d $(DESTDIR)$(PREFIX)/bin
- install -s uprightdiff $(DESTDIR)$(PREFIX)/bin/uprightdiff
-
-uprightdiff:
- g++ $(CFLAGS) main.cpp BlockMotionSearch.cpp UprightDiff.cpp \
- -lopencv_highgui \
- -lopencv_core \
- -lopencv_imgproc \
- -lboost_program_options \
- -o uprightdiff
-
-test:
- g++ $(CFLAGS) tests/RollingBlockCounterTest.cpp -lopencv_core -o test
- ./test
-
-clean:
- rm -f uprightdiff test
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 000..d8c736b
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,8 @@
+## Process this file with automake to produce Makefile.in
+AUTOMAKE_OPTIONS = foreign
+bin_PROGRAMS = uprightdiff
+uprightdiff_SOURCES = main.cpp BlockMotionSearch.cpp UprightDiff.cpp
+
+test:
+ g++ $(CFLAGS) tests/RollingBlockCounterTest.cpp -lopencv_core -o test
+ ./test
diff --git a/README.md b/README.md
index d141ea0..8cf5a50 100644
--- a/README.md
+++ b/README.md
@@ -113,7 +113,11 @@
Then compile:
-`make`
+```
+autoreconf --verbose --install --symlink
+./configure
+make
+```
And optionally install it:
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 000..9caa431
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,36 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([uprightdiff], [1.3.0],
[https://phabricator.wikimedia.org/tag/uprightdiff/])
+
+AM_INIT_AUTOMAKE
+EXTRA_CFLAGS=[-g -std=c++11 -Wall -O2]
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+
+AC_LANG_PUSH([C++])
+
+# Checks for libraries.
+# FIXME: Replace `main' with a function in `-lboost_program_options':
+AC_CHECK_LIB([boost_program_options], [main])
+# FIXME: Replace `main' with a function in `-lopencv_core':
+AC_CHECK_LIB([opencv_core], [main])
+# FIXME: Replace `main' with a function in `-lopencv_highgui':
+AC_CHECK_LIB([opencv_highgui], [main])
+# FIXME: Replace `main' with a function in `-lopencv_imgproc':
+AC_CHECK_LIB([opencv_imgproc], [main])
+AC_SEARCH_LIBS([_ZN2cv7imwriteERKNS_6StringERKNS_11_InputArrayERKSt6vectorIiSaIiEE],
[opencv_imgcodecs])
+
+# Checks for header files.
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_CHECK_HEADER_STDBOOL
+AC_C_INLINE
+
+# Checks for library functions.
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
--
To view, visit https://gerrit.wikimedia.org/r/386766
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iad0c2e869f06e3a880a994f863f46359a877c240
Gerrit-PatchSet: 3
Gerrit-Project: integration/uprightdiff
Gerrit-Branch: master
Gerrit-Owner: Legoktm
Gerrit-Reviewer: Hashar
Gerrit-Reviewer: Legoktm
Gerrit-Reviewer: Paladox
Gerrit-Reviewer: Tim Starling
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits