From 77a03ebd8da28c3811fe505b2a84e2d42743005f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 18 May 2012 20:10:46 +0200 Subject: 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 Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreConfigExtras.cmake.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/corelib/Qt5CoreConfigExtras.cmake.in') 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) -- cgit v1.2.3