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>
This commit is contained in:
parent
1f9ae50457
commit
77a03ebd8d
@ -118,7 +118,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
|
|||||||
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
|
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
|
||||||
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
|
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
|
||||||
!!ENDIF
|
!!ENDIF
|
||||||
endif()
|
|
||||||
|
|
||||||
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
|
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
|
||||||
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||||
@ -158,6 +157,8 @@ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
|
|||||||
!!ENDIF
|
!!ENDIF
|
||||||
!!ENDIF
|
!!ENDIF
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
|
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
|
||||||
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
|
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
|
||||||
!!ENDIF
|
!!ENDIF
|
||||||
|
@ -37,10 +37,7 @@ set(QT_LIBINFIX \"$${QT_LIBINFIX}\")
|
|||||||
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
|
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
|
||||||
set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
|
set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
|
||||||
|
|
||||||
if (NOT _Qt5WinMain_target)
|
|
||||||
set(_Qt5WinMain_target 1)
|
|
||||||
add_library(Qt5::WinMain STATIC IMPORTED)
|
add_library(Qt5::WinMain STATIC IMPORTED)
|
||||||
endif()
|
|
||||||
|
|
||||||
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
|
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
|
||||||
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user