summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-05-18 20:10:46 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-07 19:08:34 +0200
commit77a03ebd8da28c3811fe505b2a84e2d42743005f (patch)
treec297cadf205d36653ee525d5c157cb9d707dfa77 /src
parent1f9ae50457a3750f03fbe1be16dcb870af961d18 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index b2a95caeb3..cd330f5d34 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -37,10 +37,7 @@ set(QT_LIBINFIX \"$${QT_LIBINFIX}\")
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
-if (NOT _Qt5WinMain_target)
- set(_Qt5WinMain_target 1)
- add_library(Qt5::WinMain STATIC IMPORTED)
-endif()
+add_library(Qt5::WinMain STATIC IMPORTED)
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)