Skip to content

Commit

Permalink
Enable configure check for lrelease command (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
darealshinji authored and danieleds committed Apr 7, 2016
1 parent 2eb4b54 commit b2d7d1a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
28 changes: 23 additions & 5 deletions configure
@@ -1,9 +1,10 @@
#!/bin/sh
# Don't set `-e'!

test -n "$QMAKE" || QMAKE="qtchooser -run-tool=qmake -qt=5"
test -n "$MAKE" || MAKE="make"
test -n "$CXX" || CXX="c++"
test -n "$QMAKE" || QMAKE="qtchooser -run-tool=qmake -qt=5"
test -n "$LRELEASE" || LRELEASE="qtchooser -run-tool=lrelease -qt=5"
test -n "$MAKE" || MAKE="make"
test -n "$CXX" || CXX="c++"


errorExit() {
Expand All @@ -29,6 +30,9 @@ Defaults for the options are specified in brackets.
--fail-on-missing return exit 1 if non-optional components are missing
--lrelease COMMAND,
--lrelease=COMMAND specify lrelease command [$LRELEASE]
--qmake COMMAND,
--qmake=COMMAND specify qmake command [$QMAKE]
--qmake-args ARGS arguments to pass directly to qmake
Expand Down Expand Up @@ -78,6 +82,13 @@ while [ "$#" -ge 1 ]; do
--fail-on-missing)
fail_on_missing="yes"
;;
--lrelease=*)
LRELEASE="${key#*=}"
;;
--lrelease)
LRELEASE="$1"
shift
;;
--qmake=*)
QMAKE="${key#*=}"
;;
Expand All @@ -98,10 +109,16 @@ done

# check for QT5 qmake
printf "checking for QT5 qmake... "
$QMAKE -v 2>/dev/null 1>/dev/null
test $(echo $?) -eq 0 && echo "$QMAKE" || \
$QMAKE -help 2>/dev/null 1>/dev/null
test $? -eq 0 && echo "$QMAKE" || \
errorExit "not found!\n Try to run configure with \`--qmake /path/to/qmake-executable'." 1

# check for lrelease
printf "checking for lrelease... "
$LRELEASE -help 2>/dev/null 1>/dev/null
test $? -eq 0 && echo "$LRELEASE" || \
errorExit "not found!\n Try to run configure with \`--lrelease /path/to/lrelease-executable'."

check c++ "$CXX" 1

# check C++ compiler functionality
Expand Down Expand Up @@ -166,4 +183,5 @@ $QMAKE PREFIX="$PREFIX" \
QMAKE_CXX="$CXX" \
QMAKE_CXXFLAGS="$CXXFLAGS $CPPFLAGS" \
QMAKE_LFLAGS="$LDFLAGS" \
LRELEASE="$LRELEASE" \
"$@" notepadqq.pro && echo "done" || errorExit "error!" 1
4 changes: 3 additions & 1 deletion src/ui/ui.pro
Expand Up @@ -38,7 +38,9 @@ isEmpty(DESTDIR) {
}
}

LRELEASE = qtchooser -run-tool=lrelease -qt=5
isEmpty(LRELEASE) {
LRELEASE = qtchooser -run-tool=lrelease -qt=5
}

APPDATADIR = "$$DESTDIR/../appdata"
BINDIR = "$$DESTDIR/../bin"
Expand Down

0 comments on commit b2d7d1a

Please sign in to comment.