Merge pull request #6331 from spycrab/deprecate_wx

[RFC] Qt/Wx: Turn Qt into the default interface
This commit is contained in:
Léo Lam 2018-04-21 18:36:10 +02:00 committed by GitHub
commit 9dcc8131df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 46 additions and 45 deletions

View File

@ -20,8 +20,8 @@ option(USE_EGL "Enables EGL OpenGL Interface" OFF)
option(TRY_X11 "Enables X11 Support" ON) option(TRY_X11 "Enables X11 Support" ON)
option(USE_SHARED_ENET "Use shared libenet if found rather than Dolphin's soon-to-compatibly-diverge version" OFF) option(USE_SHARED_ENET "Use shared libenet if found rather than Dolphin's soon-to-compatibly-diverge version" OFF)
option(USE_UPNP "Enables UPnP port mapping support" ON) option(USE_UPNP "Enables UPnP port mapping support" ON)
option(ENABLE_WX "Enable wxWidgets (Default)" ON) option(ENABLE_QT2 "Enable Qt (Default)" ON)
option(ENABLE_QT2 "Enable Qt2 (use the other experimental Qt interface)" ON) option(ENABLE_WX "Enable wxWidgets (Legacy)" ON)
option(ENABLE_LTO "Enables Link Time Optimization" OFF) option(ENABLE_LTO "Enables Link Time Optimization" OFF)
option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF) option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF)
option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF) option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF)

View File

@ -5,7 +5,7 @@ message(STATUS "Found Qt version ${Qt5Core_VERSION}")
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
add_executable(dolphin-emu-qt2 add_executable(dolphin-emu
AboutDialog.cpp AboutDialog.cpp
CheatsManager.cpp CheatsManager.cpp
FIFOPlayerWindow.cpp FIFOPlayerWindow.cpp
@ -113,20 +113,20 @@ add_executable(dolphin-emu-qt2
Updater.cpp Updater.cpp
) )
target_compile_definitions(dolphin-emu-qt2 target_compile_definitions(dolphin-emu
PRIVATE PRIVATE
-DQT_USE_QSTRINGBUILDER -DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_TO_ASCII
) )
target_include_directories(dolphin-emu-qt2 target_include_directories(dolphin-emu
PRIVATE PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
) )
target_link_libraries(dolphin-emu-qt2 target_link_libraries(dolphin-emu
PRIVATE PRIVATE
core core
Qt5::Widgets Qt5::Widgets
@ -134,7 +134,7 @@ PRIVATE
) )
if(WIN32) if(WIN32)
target_sources(dolphin-emu-qt2 PRIVATE DolphinQt2.manifest) target_sources(dolphin-emu PRIVATE DolphinQt2.manifest)
endif() endif()
# Handle localization # Handle localization
@ -143,7 +143,7 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot") set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot")
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po) file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
target_sources(dolphin-emu-qt2 PRIVATE ${pot_file} ${LINGUAS}) target_sources(dolphin-emu PRIVATE ${pot_file} ${LINGUAS})
source_group("Localization" FILES ${LINGUAS}) source_group("Localization" FILES ${LINGUAS})
source_group("Localization\\\\Generated" FILES ${pot_file}) source_group("Localization\\\\Generated" FILES ${pot_file})
@ -152,7 +152,7 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang}) set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang})
set(mo ${mo_dir}/dolphin-emu.mo) set(mo ${mo_dir}/dolphin-emu.mo)
target_sources(dolphin-emu-qt2 PRIVATE ${mo}) target_sources(dolphin-emu PRIVATE ${mo})
source_group("Localization\\\\Generated" FILES ${mo}) source_group("Localization\\\\Generated" FILES ${mo})
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -171,39 +171,38 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
endif() endif()
if(APPLE) if(APPLE)
# Note: This is copied from DolphinQt, based on the DolphinWX version.
include(BundleUtilities) include(BundleUtilities)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/dolphin-emu-qt2.app) set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app)
# Ask for an application bundle. # Ask for an application bundle.
set_target_properties(dolphin-emu-qt2 PROPERTIES set_target_properties(dolphin-emu PROPERTIES
MACOSX_BUNDLE true MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
OUTPUT_NAME Dolphin
) )
# Copy qt.conf into the bundle # Copy qt.conf into the bundle
target_sources(dolphin-emu-qt2 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf") target_sources(dolphin-emu PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# Copy icon into the bundle # Copy icon into the bundle
target_sources(dolphin-emu-qt2 PRIVATE "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns") target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns")
set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/Dolphin.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/Dolphin.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# Copy Qt plugins into the bundle # Copy Qt plugins into the bundle
get_target_property(qtcocoa_location Qt5::QCocoaIntegrationPlugin LOCATION) get_target_property(qtcocoa_location Qt5::QCocoaIntegrationPlugin LOCATION)
target_sources(dolphin-emu-qt2 PRIVATE "${qtcocoa_location}") target_sources(dolphin-emu PRIVATE "${qtcocoa_location}")
set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms) set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms)
get_target_property(qtmacstyle_location Qt5::QMacStylePlugin LOCATION) get_target_property(qtmacstyle_location Qt5::QMacStylePlugin LOCATION)
target_sources(dolphin-emu-qt2 PRIVATE "${qtmacstyle_location}") target_sources(dolphin-emu PRIVATE "${qtmacstyle_location}")
set_source_files_properties("${qtmacstyle_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/styles) set_source_files_properties("${qtmacstyle_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/styles)
# Copy resources into the bundle # Copy resources into the bundle
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys")
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*")
foreach(res ${resources}) foreach(res ${resources})
target_sources(dolphin-emu-qt2 PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
get_filename_component(resdir "${res}" DIRECTORY) get_filename_component(resdir "${res}" DIRECTORY)
set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources/${resdir}") MACOSX_PACKAGE_LOCATION "Resources/${resdir}")
@ -212,7 +211,7 @@ if(APPLE)
# Update library references to make the bundle portable # Update library references to make the bundle portable
include(DolphinPostprocessBundle) include(DolphinPostprocessBundle)
dolphin_postprocess_bundle(dolphin-emu-qt2) dolphin_postprocess_bundle(dolphin-emu)
else() else()
install(TARGETS dolphin-emu-qt2 RUNTIME DESTINATION ${bindir}) install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir})
endif() endif()

View File

@ -13,10 +13,7 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{FA3FA62B-6F58-4B86-9453-4D149940A066}</ProjectGuid> <ProjectGuid>{FA3FA62B-6F58-4B86-9453-4D149940A066}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
<!--
Enable this once wxwidgets is completely removed
<ProjectName>Dolphin</ProjectName> <ProjectName>Dolphin</ProjectName>
-->
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">

View File

@ -26,7 +26,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>dolphin-emu-qt2</string> <string>Dolphin</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>Dolphin.icns</string> <string>Dolphin.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>

View File

@ -2,7 +2,7 @@ if(NOT wxWidgets_FOUND)
return() return()
endif() endif()
add_executable(dolphin-emu add_executable(dolphin-emu-wx
AboutDolphin.cpp AboutDolphin.cpp
ControllerConfigDiag.cpp ControllerConfigDiag.cpp
Cheats/ActionReplayCodesPanel.cpp Cheats/ActionReplayCodesPanel.cpp
@ -83,7 +83,7 @@ add_executable(dolphin-emu
WxUtils.cpp WxUtils.cpp
) )
target_link_libraries(dolphin-emu target_link_libraries(dolphin-emu-wx
PRIVATE PRIVATE
bdisasm bdisasm
core core
@ -95,22 +95,24 @@ PRIVATE
if(APPLE) if(APPLE)
# Add resource files to application bundle. # Add resource files to application bundle.
set(RESOURCES "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns") set(RESOURCES "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns")
target_sources(dolphin-emu PRIVATE ${RESOURCES}) target_sources(dolphin-emu-wx PRIVATE ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES set_source_files_properties(${RESOURCES} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources) MACOSX_PACKAGE_LOCATION Resources)
endif() endif()
if(WIN32) if(WIN32)
target_sources(dolphin-emu PRIVATE target_sources(dolphin-emu-wx PRIVATE
DolphinWX.manifest DolphinWX.manifest
DolphinWX.rc DolphinWX.rc
) )
endif() endif()
target_link_libraries(dolphin-emu-wx PRIVATE ${LIBS})
if(USE_X11) if(USE_X11)
find_package(GTK2 REQUIRED) find_package(GTK2 REQUIRED)
target_link_libraries(dolphin-emu PRIVATE ${GTK2_LIBRARIES}) target_link_libraries(dolphin-emu-wx PRIVATE ${GTK2_LIBRARIES})
target_include_directories(dolphin-emu PRIVATE ${GTK2_INCLUDE_DIRS}) target_include_directories(dolphin-emu-wx PRIVATE ${GTK2_INCLUDE_DIRS})
endif() endif()
# Handle localization # Handle localization
@ -119,16 +121,16 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot") set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot")
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po) file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
target_sources(dolphin-emu PRIVATE ${pot_file} ${LINGUAS}) target_sources(dolphin-emu-wx PRIVATE ${pot_file} ${LINGUAS})
source_group("Localization" FILES ${LINGUAS}) source_group("Localization" FILES ${LINGUAS})
source_group("Localization\\\\Generated" FILES ${pot_file}) source_group("Localization\\\\Generated" FILES ${pot_file})
foreach(po ${LINGUAS}) foreach(po ${LINGUAS})
get_filename_component(lang ${po} NAME_WE) get_filename_component(lang ${po} NAME_WE)
set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang}) set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang})
set(mo ${mo_dir}/dolphin-emu.mo) set(mo ${mo_dir}/dolphin-emu-wx.mo)
target_sources(dolphin-emu PRIVATE ${mo}) target_sources(dolphin-emu-wx PRIVATE ${mo})
source_group("Localization\\\\Generated" FILES ${mo}) source_group("Localization\\\\Generated" FILES ${mo})
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -147,18 +149,21 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE)
endif() endif()
if(APPLE) if(APPLE)
include(BundleUtilities)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolphinWx.app)
# Ask for an application bundle. # Ask for an application bundle.
set_target_properties(dolphin-emu PROPERTIES set_target_properties(dolphin-emu-wx PROPERTIES
MACOSX_BUNDLE true MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
OUTPUT_NAME Dolphin OUTPUT_NAME DolphinWx
) )
# Copy resources in the bundle # Copy resources in the bundle
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys") set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys")
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*") file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*")
foreach(res ${resources}) foreach(res ${resources})
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}") target_sources(dolphin-emu-wx PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
get_filename_component(resdir "${res}" DIRECTORY) get_filename_component(resdir "${res}" DIRECTORY)
set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources/${resdir}") MACOSX_PACKAGE_LOCATION "Resources/${resdir}")
@ -167,19 +172,19 @@ if(APPLE)
# Update library references to make the bundle portable # Update library references to make the bundle portable
include(DolphinPostprocessBundle) include(DolphinPostprocessBundle)
dolphin_postprocess_bundle(dolphin-emu) dolphin_postprocess_bundle(dolphin-emu-wx)
# Install bundle into systemwide /Applications directory. # Install bundle into systemwide /Applications directory.
install(TARGETS dolphin-emu DESTINATION /Applications) install(TARGETS dolphin-emu-wx DESTINATION /Applications)
elseif(WIN32) elseif(WIN32)
set_target_properties(dolphin-emu PROPERTIES set_target_properties(dolphin-emu-wx PROPERTIES
WIN32_EXECUTABLE ON WIN32_EXECUTABLE ON
) )
add_custom_command(TARGET dolphin-emu add_custom_command(TARGET dolphin-emu-wx
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $<TARGET_FILE_DIR:dolphin-emu>/Sys COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $<TARGET_FILE_DIR:dolphin-emu-wx>/Sys
) )
else() else()
install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir}) install(TARGETS dolphin-emu-wx RUNTIME DESTINATION ${bindir})
endif() endif()
set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-emu) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-emu-wx)

View File

@ -12,7 +12,7 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{47411FDB-1BF2-48D0-AB4E-C7C41160F898}</ProjectGuid> <ProjectGuid>{47411FDB-1BF2-48D0-AB4E-C7C41160F898}</ProjectGuid>
<ProjectName>Dolphin</ProjectName> <ProjectName>DolphinWx</ProjectName>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@ -26,7 +26,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>Dolphin</string> <string>DolphinWx</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>Dolphin.icns</string> <string>Dolphin.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>