Only create the Qt5::WinMain target if it doesn't exist yet.

Multiple calls to find_package(Qt5Core) would otherwise attempt to
create multiple targets of the same name.

Change-Id: I5639671fec66d4dd62dcce018dea5d18dcfd3dc3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Stephen Kelly 2012-07-11 14:13:15 +02:00 committed by Qt by Nokia
parent 2832aaacd4
commit cf5d83e56d

View File

@ -41,6 +41,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 TARGET Qt5::WinMain)
add_library(Qt5::WinMain STATIC IMPORTED) add_library(Qt5::WinMain STATIC IMPORTED)
!!IF !isEmpty(CMAKE_DEBUG_TYPE) !!IF !isEmpty(CMAKE_DEBUG_TYPE)
@ -64,6 +65,7 @@ set_target_properties(Qt5::WinMain PROPERTIES
!!ENDIF !!ENDIF
) )
!!ENDIF !!ENDIF
endif()
!!ENDIF !!ENDIF
get_filename_component(_Qt5CoreConfigDir ${CMAKE_CURRENT_LIST_FILE} PATH) get_filename_component(_Qt5CoreConfigDir ${CMAKE_CURRENT_LIST_FILE} PATH)