From 63660402d8d803b97c676395895c25e550c07f94 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 22 May 2015 15:02:23 +0200 Subject: Run license checker in qmake Check for a valid license not only in configure, but also in qmake. To limit the runtime overhead we cache the day of the last run in a .stash file. This allows us to run licheck only for the top-level qmake call, and only once per day. This requires an updated licheck executable that supports the new check mode. [ChangeLog][Tools][qmake] For commercial builds, qmake now checks for a valid Qt license. This requires setting up a Qt Account (or .qt-license file) on the development machine. Change-Id: I2c2a05a4602cc661560568b76ddf520cb8134769 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/default_pre.prf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mkspecs/features/default_pre.prf') diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf index b06b9d6cfc..eb3281ea1d 100644 --- a/mkspecs/features/default_pre.prf +++ b/mkspecs/features/default_pre.prf @@ -7,3 +7,18 @@ CONFIG = \ lex yacc debug exceptions depend_includepath \ testcase_targets import_plugins import_qpa_plugin \ $$CONFIG + +!build_pass:defined(QT_EDITION, var):!equals(QT_EDITION, "OpenSource"):!equals(QT_EDITION, "Preview") { + # + # call license checker (but cache result for one day) + # + today = $$section(_DATE_, " ", 0, 2) + !isEqual(QMAKE_LICHECK_TIMESTAMP, $$today) { + !system("$$system_quote($$system_path($$[QT_HOST_BINS/src]/$$QT_LICHECK)) check" \ + "$$QT_RELEASE_DATE $$[QMAKE_SPEC] $$[QMAKE_XSPEC]"): \ + error("License check failed! Giving up ...") + + cache(QMAKE_LICHECK_TIMESTAMP, set stash, today) + } + unset(today) +} -- cgit v1.2.3