Expand the 'existing target guard' in generated CMake files.
authorStephen Kelly <stephen.kelly@kdab.com>
Fri, 18 May 2012 18:10:46 +0000 (20:10 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 7 Jun 2012 17:08:34 +0000 (19:08 +0200)
commit77a03ebd8da28c3811fe505b2a84e2d42743005f
treec297cadf205d36653ee525d5c157cb9d707dfa77
parent1f9ae50457a3750f03fbe1be16dcb870af961d18
Expand the 'existing target guard' in generated CMake files.

This way the target will be created and have its properties
populated only one time.

I tried wrapping the whole file in an 'include guard', but that
broke the unit test in tests/auto/cmake/pass1 (and
the qt5_use_module function), because the function causes the
variables in the Config file to not exist outside of the
scope (eg for include directories), and yet, Qt5${Module}_FOUND is
still true even when the find_package was previously called in a
function, so it is not found and processed again.

The change in Qt5CoreConfigExtras.cmake does not need to be guarded
as it is only ever included from Qt5CoreConfig.

Change-Id: Iaa016563db5eb61294360ac9e003c9c923393d8c
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
mkspecs/cmake/Qt5BasicConfig.cmake.in
src/corelib/Qt5CoreConfigExtras.cmake.in