From 3279b07302fde0eb14f9b197c9ad2e14d512817e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 6 Apr 2009 19:39:03 +0200 Subject: make shadow builds with default moc/ui dirs work again append the source dir to the include path, but only after the dirs with the generated files. this seems to have worked before only accidentally: the unqualified default dirs were expanded to the source dir instead of the build dir, but the build dir is added implicitly by default, so things magically worked. now that we qualify the moc/ui dirs, projects relying on the strange side effect suddenly break. we should probably add the source dir to the include path by default, but this coupling to uic/moc is closer to the historical behavior and thus should be safer. Reviewed-by: mariusSO --- mkspecs/features/include_source_dir.prf | 1 + mkspecs/features/moc.prf | 7 +++++++ mkspecs/features/uic.prf | 7 +++++++ 3 files changed, 15 insertions(+) create mode 100644 mkspecs/features/include_source_dir.prf diff --git a/mkspecs/features/include_source_dir.prf b/mkspecs/features/include_source_dir.prf new file mode 100644 index 0000000..8794998 --- /dev/null +++ b/mkspecs/features/include_source_dir.prf @@ -0,0 +1 @@ +!equals(_PRO_FILE_PWD_, $$OUT_PWD):INCLUDEPATH *= . diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index f1dcf37..f18d462 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -66,6 +66,13 @@ win32:moc_dir_short ~= s,^.:,/, contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH += $$MOC_DIR else:INCLUDEPATH += $$OUT_PWD/$$MOC_DIR +# Backwards compatibility: Make shadow builds with default MOC_DIR work +# if the user did not add the source dir explicitly. +equals(MOC_DIR, .) { + CONFIG -= include_source_dir + CONFIG = include_source_dir $$CONFIG +} + #auto depend on moc unix:!no_mocdepend { moc_source.depends += $$first(QMAKE_MOC) diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index c7b1686..0c7fb1b 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -39,6 +39,13 @@ win32:ui_dir_short ~= s,^.:,/, contains(ui_dir_short, ^[/\\\\].*):INCLUDEPATH += $$UI_HEADERS_DIR else:INCLUDEPATH += $$OUT_PWD/$$UI_HEADERS_DIR +# Backwards compatibility: Make shadow builds with default UI_DIR work +# if the user did not add the source dir explicitly. +equals(UI_DIR, .) { + CONFIG -= include_source_dir + CONFIG = include_source_dir $$CONFIG +} + uic3 { isEmpty(FORMS3) { UIC3_FORMS = FORMS -- cgit v0.12