CMake: Add WinMain support
Change-Id: I85c56555bc47dcf348daeb3435c621529aa2d381 Fixes: QTBUG-75195 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
016351d267
commit
9298033ed6
@ -1657,12 +1657,6 @@ function(add_qt_executable name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
# Workaround for not having ported the winmain / qtmain static library
|
|
||||||
# which is always linked in by qmake.
|
|
||||||
set_target_properties("${name}" PROPERTIES WIN32_EXECUTABLE 0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT arg_NO_INSTALL)
|
if(NOT arg_NO_INSTALL)
|
||||||
qt_install(TARGETS "${name}"
|
qt_install(TARGETS "${name}"
|
||||||
RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}"
|
RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}"
|
||||||
|
@ -54,3 +54,5 @@ if(QT_FEATURE_gui AND QT_FEATURE_widgets)
|
|||||||
add_subdirectory(printsupport)
|
add_subdirectory(printsupport)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(plugins)
|
add_subdirectory(plugins)
|
||||||
|
|
||||||
|
add_subdirectory(winmain)
|
||||||
|
48
src/winmain/.prev_CMakeLists.txt
Normal file
48
src/winmain/.prev_CMakeLists.txt
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Generated from winmain.pro.
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
## qtLibraryTarget$$TARGET$$QT_LIBINFIX Module:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
add_qt_module(qtLibraryTarget$$TARGET$$QT_LIBINFIX
|
||||||
|
STATIC
|
||||||
|
DEFINES
|
||||||
|
QT_NO_FOREACH
|
||||||
|
PUBLIC_LIBRARIES
|
||||||
|
Qt::Core
|
||||||
|
)
|
||||||
|
|
||||||
|
#### Keys ignored in scope 1:.:.:winmain.pro:<TRUE>:
|
||||||
|
# CONFIG = "static"
|
||||||
|
# DESTDIR = "$$QT.core.libs"
|
||||||
|
# TEMPLATE = "lib"
|
||||||
|
# _LOADED = "qt_installs" "qt_targets" "qt_build_paths" "qt_common"
|
||||||
|
|
||||||
|
## Scopes:
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
#### Keys ignored in scope 3:.:.:winmain.pro:QT_FEATURE_debug_and_release:
|
||||||
|
# CONFIG = "build_all"
|
||||||
|
|
||||||
|
#### Keys ignored in scope 4:.:.:winmain.pro:MSVC:
|
||||||
|
# QMAKE_CFLAGS_DEBUG = "--Zi" "-Z7"
|
||||||
|
|
||||||
|
extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION mingw
|
||||||
|
DEFINES
|
||||||
|
QT_NEEDS_QMAIN
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION WINRT
|
||||||
|
SOURCES
|
||||||
|
qtmain_winrt.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION NOT WINRT
|
||||||
|
SOURCES
|
||||||
|
qtmain_win.cpp
|
||||||
|
LIBRARIES
|
||||||
|
shell32
|
||||||
|
)
|
||||||
|
|
||||||
|
#### Keys ignored in scope 10:.:.:winmain.pro:else:
|
||||||
|
# CONFIG = "-qt"
|
28
src/winmain/CMakeLists.txt
Normal file
28
src/winmain/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# special case begin
|
||||||
|
if (NOT WIN32)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_qt_module(WinMain
|
||||||
|
STATIC
|
||||||
|
NO_MODULE_HEADERS
|
||||||
|
DEFINES
|
||||||
|
QT_NO_FOREACH
|
||||||
|
INCLUDE_DIRECTORIES
|
||||||
|
$<TARGET_PROPERTY:Qt::Core,INTERFACE_INCLUDE_DIRECTORIES>
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(WinMain CONDITION WINRT
|
||||||
|
SOURCES qtmain_winrt.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(WinMain CONDITION NOT WINRT
|
||||||
|
SOURCES qtmain_win.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(WinMain CONDITION MINGW
|
||||||
|
DEFINES QT_NEEDS_QMAIN
|
||||||
|
)
|
||||||
|
|
||||||
|
extend_target(Core LIBRARIES WinMain)
|
||||||
|
# special case end
|
Loading…
x
Reference in New Issue
Block a user