[PATCH] qmake: use a dedicated build script to generate ssrf-version.h

Thiago Macieira thiago at macieira.org
Wed Feb 11 21:46:26 PST 2015


Sorry for the delay, guys. Work has been busy the past three weeks.

The patch is good. I just have an update to support out-of-source builds.

On Friday 06 February 2015 23:16:26 Lubomir I. Ivanov wrote:
> +
> +# use a compiler target that has a phony input and is forced on each `make`
> invocation 
> +# the resulted file is not a link target and is cleared with
> `make clean` +PHONY_DEPS = .
> +version_h.input = PHONY_DEPS
> +version_h.depends = FORCE
> +version_h.output = $$VERSION_FILE
> +version_h.commands = @echo checking $$VERSION_FILE ... && sh
> ./scripts/write-version $$VERSION_FILE $$VERSION $$VER_OS +version_h.

Instead;

	version_h.commands = cd $$PWD && sh $$PWD/scripts/write-version 
$$VERSION_FILE $$VERSION $$VER_OS
	silent: version_h.commands = @echo Checking $$VERSION_FILE && 
$$version_h.commads

[sorry for the line line breaks]

> CONFIG += no_link
> +QMAKE_EXTRA_COMPILERS += version_h
> +QMAKE_CLEAN += $$VERSION_FILE
> diff --git a/subsurface.pro b/subsurface.pro
> index 2cc6b09..9e9ef2b 100644
> --- a/subsurface.pro
> +++ b/subsurface.pro
> @@ -20,8 +20,12 @@ else: TARGET = subsurface
>  QMAKE_CLEAN += $$TARGET
> 
>  VERSION = 4.4
> +VERSION_FILE = ssrf-version.h

VERSION_FILE = $$OUT_PWD/ssrf-version.h

> +# create a blank VERSION_FILE if missing
> +system(cat $$VERSION_FILE > /dev/null 2>&1 || touch $$VERSION_FILE)

I'd write

	test -r $$VERSION_FILE || touch $$VERSION_FILE

But the result is the same, so no need to change here.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358


More information about the subsurface mailing list