Commit Graph

24 Commits

Author SHA1 Message Date
Kai Köhne
646d698ffe Allow building Qt examples with qmake in-source
This reverts commit c686e885c0
and commit d64abf8166.

We don't feature .qmake.cache/.qmake.super files anymore in the
source directory, so there's no problem anymore.

Change-Id: Ib820a109fbfbad70d85b0f14ef72915882217ca3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-12 11:06:10 +02:00
Joerg Bornemann
069fc33e8a Remove the -no-compile-examples configure switch
If '-make examples -no-compile-examples' was specified, sources of Qt's
examples would be installed, but the examples would not be built.

This switch has always been a source for confusion and is only
interesting for distributors, who can just package the examples
directory tree.

Change-Id: I0291d70e4951d98b553a4abf217db49d05316d3a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-11 00:40:46 +02:00
Kai Koehne
1e4801c7ce Fix build with -no-compile-examples
configure -no-compile-examples means that the examples won't be
compiled, but processed by qmake to generate install targets. So we
shouldn't do any substitution (like it is done for CMake targets), or
extra compilers / copies (like it is done for qmltypes).

Also install the qmldir files that some qml examples need.

Fixes: QTBUG-83375
Fixes: QTBUG-83704
Change-Id: I6a9393bd914d98a5d85f4089205510e49a435842
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 12:33:02 +02:00
Oliver Wolff
c686e885c0 qmake: Disallow building Qt examples inside the source tree
Building examples inside a Qt source tree is considered unsupported.
Instead of checking, whether the build is done "in source" inside the
source directory, we also have to check for "shadowed example builds" as
they are done by Creator. An example would be:
qtbase/examples/widgets/widgets/build-wiggly as a shadow build for
qtbase/examples/widgets/widgets/wiggly.

Fixes: QTBUG-76237
Change-Id: Iceb88af006fad249a4c13fa0b0345cf3f7086252
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-10-24 10:41:29 +02:00
Alexander Volkov
22d3eeebb0 fix installation of resources for example sources
contains() interprets the regexp as being implicitly
anchored, so the leading part of the path needs to be
explicitly matched.

Change-Id: I1efa07dc99bb2db1717d2a66621899e23c144164
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-02-21 16:32:49 +00:00
Oswald Buddenhagen
b772d9cbd7 fix example source installation of qrc/rc files in subdirs
such a project structure violates the assumption that the referenced
resources are specified relative to the sub-project root, so we must
resolve them to absolute paths manually.

Task-number: QTBUG-65753
Change-Id: I8bcd5c6e7d7c6a713e5fcd3668be7d2f23169501
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-01-18 13:48:23 +00:00
Oswald Buddenhagen
d64abf8166 refuse to build examples inside the qt source tree stand-alone
doing so is somewhat likely to cause follow-up issues, as it turns the
source tree into a build tree as a side effect.

note that this change does not affect building examples inside an
install tree, even if doing that is still ugly.

Change-Id: I386bf2ab959269f55553c70b7551dd9afec2bcba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:48 +00:00
Oswald Buddenhagen
1da25fe85a fix excessive execution of code meant for examples only
qt_example_installs.prf is loaded by every sub-project inside the qt
tree, as qt_build_config adds it.

Change-Id: Ice7e81b280b6964ed5cc1b9f1501bf74df737d7e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:44 +00:00
Oswald Buddenhagen
1480066592 employ return() inside qt_example_installs.prf gainfully
reduces the indentation level.

Change-Id: I7851ffc5e9ecaaa3ae375d14fd245ea3747f61b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:40 +00:00
Oswald Buddenhagen
f91bbd2438 make handling of qml module search path saner
excise knowledge of QTREPOS from qt.prf - this is a private variable of
the qt build system which the public functions should not know anything
about.

instead, move this handling to a function in qt_build_config.prf (where
QTREPOS comes from in the first place), and call it from qt_app.prf and
qt_example_installs.prf (which should be the only consumers within qt).

qt.prf now also checks that the qml install dir actually exists, which
is not the case during a modular prefix build of qtdeclarative.

not really incidentally, this fixes modular static builds of
qtdeclarative.

Task-number: QTBUG-57308
Change-Id: I31465b9cd400483264fc236934c6f9f26a5fdd73
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-25 17:31:02 +00:00
Oswald Buddenhagen
5b5b7f97b8 complain about examples which don't install themselves properly
Change-Id: I6555d449430111639b084ddc3e4b4bc14b61bc30
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-18 09:07:32 +00:00
Oswald Buddenhagen
e34ebe6328 automate the installation of some more example source files
Change-Id: I61f9f4882c5a7743817059824250958f5ce4a603
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-05-03 10:25:14 +00:00
Oswald Buddenhagen
967372c975 sanitize qt rpath handling, in particular on mac
the addition of qt's rpath belongs into qt.prf - even on mac.
so consolidate the two implementations.
as a nice "side effect", we get relative rpaths also on linux.
another "side effect" is that we don't unnecessarily add the qt rpath to
qt modules also on linux.

the qt rpath addition mechanism should not be responsible for setting
the policy who gets a relative rpath, so move the logic to higher-level
callers.

Change-Id: I52e8fe2e8279e7b1ac25fae758867a5cb1cafcf8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-09-17 16:36:12 +00:00
Oliver Wolff
95f0fab9f8 Do not install example sources when using vc(x)proj
Inside Visual Studio these files (INSTALLS) will end up in deployment.
They do not make sense there and might even cause clashes, which prevent
the project file from being loaded (for example when a qrc file is added
to "Resource files" and "Deployment files")

Change-Id: Ifa68c52a83b2bf3948738c7aa1cf9c56b331dc80
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-13 22:03:07 +00:00
Oswald Buddenhagen
f2d76cb524 clear OBJECTIVE_SOURCES as well
the newly added mac examples use it, so it needs to be grounded.

a more generic solution would be clearing out QMAKE_EXTRA_COMPILERS, but
many prf files will be loaded after us, possibly nullifying our effort.

Task-number: QTBUG-35680
Change-Id: I3aba7595898baac14bd41e9fae2ff24507187c6a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-20 14:58:48 +01:00
Oswald Buddenhagen
8ea19caacf add -compile-examples configure option
this overrides the magic that makes examples only install their sources
in production builds.

packagers may want to force the build of the examples, so they can
package them up for demo purposes.
this is actually why we formerly had the split between demos and
examples ...

Task-number: QTBUG-30788
Change-Id: I5633f69404c5aa6846f5496e8f161a273a7a7da3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-26 10:09:58 +02:00
Oswald Buddenhagen
8bfbaa4178 activate example (non-)build magic only in configured trees
otherwise we assume that the user is trying to build a random example
which just happens to live inside a qt module's repository.

Task-number: QTBUG-29756
Change-Id: I17f217b4235fbe04f2c49d1d92ce08b86bb259b9
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-20 19:04:45 +01:00
Oswald Buddenhagen
218179ce2f don't suppress building examples in non-prefix builds
these have no (useful) install target, so it makes no sense to reduce
the "build" to installing sources. suppressing the actual build can be
achieved with -nomake examples instead.
conversely, as the build dir is the install dir, people actually need to
be able to (selectively) build examples in there.

Task-number: QTBUG-29756
Change-Id: I98f34235442b552e51c0d5f5cec96a3eab4f1e7f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-02-20 15:22:55 +01:00
Oswald Buddenhagen
2b397f985e do not actually build examples in production builds
-developer-build enables an actual build of examples, based on the
assumption that developers want to test it (it can be still disabled
with -nomake examples). regular users otoh want only the examples
sources installed.

Change-Id: Ifc6a108099929175a3960480802b271a758fdd38
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-31 15:51:21 +01:00
Oswald Buddenhagen
839009c74f fix duplicated installation of qml example files
we need to collect the sources of the install targets for the check that
all files have been properly handled, but of course we must not add these
files to the source install target, as that would mean double installation.

Change-Id: I6acb56f2a993b6ed81d1031d5dc0a0da30a53b54
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-31 15:51:03 +01:00
Oswald Buddenhagen
8e36b8de02 mark a bunch of features as internal
Change-Id: I5ad28827ff317985414e859263af85ceec31207c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-12-12 21:48:02 +01:00
Oswald Buddenhagen
b8d0bde59c install a sane top-level examples.pro file
generally, don't install anything from the top-level examples dirs
automatically. the global README and the aggregator examples.pro are
installed explicitly.

Change-Id: I5f6b8760f37d917b800fa85979896a471778cac0
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-11 13:37:57 +01:00
Oswald Buddenhagen
25aa803af7 auto-collect qml-related sources
Change-Id: Ia5b56227c2c1f18254d35f6105ac3a146f085e3b
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2012-12-03 15:56:28 +01:00
Oswald Buddenhagen
aeb036ed87 centralize and fixup example sources install targets
it's confusing for the users if the examples' project files contain code
to install their own sources. also, this constitutes an enormous code
duplication, and lots of mistakes. consequently, automate it.

more or less as a side effect, this also removes the entirely meaningless
target installs in subdirs projects.

Task-number: QTBUG-28184
Change-Id: I9fc1367a06db9e2c46aeb67d68729a4f67163ef9
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-29 20:21:11 +01:00