From 694df74b0bd535649c48b895faea54c9c95d1d6d Mon Sep 17 00:00:00 2001 From: spycrab Date: Fri, 26 Jan 2018 09:26:45 +0100 Subject: [PATCH] Qt/Wx: Turn Qt into the default interface --- CMakeLists.txt | 4 +-- Source/Core/DolphinQt2/CMakeLists.txt | 35 +++++++++--------- Source/Core/DolphinQt2/DolphinQt2.vcxproj | 3 -- Source/Core/DolphinQt2/Info.plist.in | 2 +- Source/Core/DolphinWX/CMakeLists.txt | 43 +++++++++++++---------- Source/Core/DolphinWX/DolphinWX.vcxproj | 2 +- Source/Core/DolphinWX/Info.plist.in | 2 +- 7 files changed, 46 insertions(+), 45 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64e1bb52f4..78e4f5e170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ option(USE_EGL "Enables EGL OpenGL Interface" OFF) 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_UPNP "Enables UPnP port mapping support" ON) -option(ENABLE_WX "Enable wxWidgets (Default)" ON) -option(ENABLE_QT2 "Enable Qt2 (use the other experimental Qt interface)" ON) +option(ENABLE_QT2 "Enable Qt (Default)" ON) +option(ENABLE_WX "Enable wxWidgets (Legacy)" ON) 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_HEADLESS "Enables running Dolphin as a headless variant" OFF) diff --git a/Source/Core/DolphinQt2/CMakeLists.txt b/Source/Core/DolphinQt2/CMakeLists.txt index a59660babc..b2375c740d 100644 --- a/Source/Core/DolphinQt2/CMakeLists.txt +++ b/Source/Core/DolphinQt2/CMakeLists.txt @@ -5,7 +5,7 @@ message(STATUS "Found Qt version ${Qt5Core_VERSION}") set(CMAKE_AUTOMOC ON) -add_executable(dolphin-emu-qt2 +add_executable(dolphin-emu AboutDialog.cpp CheatsManager.cpp FIFOPlayerWindow.cpp @@ -113,20 +113,20 @@ add_executable(dolphin-emu-qt2 Updater.cpp ) -target_compile_definitions(dolphin-emu-qt2 +target_compile_definitions(dolphin-emu PRIVATE -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII ) -target_include_directories(dolphin-emu-qt2 +target_include_directories(dolphin-emu PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ) -target_link_libraries(dolphin-emu-qt2 +target_link_libraries(dolphin-emu PRIVATE core Qt5::Widgets @@ -134,7 +134,7 @@ PRIVATE ) if(WIN32) - target_sources(dolphin-emu-qt2 PRIVATE DolphinQt2.manifest) + target_sources(dolphin-emu PRIVATE DolphinQt2.manifest) endif() # 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") 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\\\\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 ${mo_dir}/dolphin-emu.mo) - target_sources(dolphin-emu-qt2 PRIVATE ${mo}) + target_sources(dolphin-emu PRIVATE ${mo}) source_group("Localization\\\\Generated" FILES ${mo}) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") @@ -171,39 +171,38 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE) endif() if(APPLE) - # Note: This is copied from DolphinQt, based on the DolphinWX version. - 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. - set_target_properties(dolphin-emu-qt2 PROPERTIES + set_target_properties(dolphin-emu PROPERTIES MACOSX_BUNDLE true MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in + OUTPUT_NAME Dolphin ) # 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) # 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) # Copy Qt plugins into the bundle 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) 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) # Copy resources into the bundle 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/*") 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) set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${resdir}") @@ -212,7 +211,7 @@ if(APPLE) # Update library references to make the bundle portable include(DolphinPostprocessBundle) - dolphin_postprocess_bundle(dolphin-emu-qt2) + dolphin_postprocess_bundle(dolphin-emu) else() - install(TARGETS dolphin-emu-qt2 RUNTIME DESTINATION ${bindir}) + install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir}) endif() diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj index 1d925a3950..cf75a2e9bb 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj @@ -13,10 +13,7 @@ {FA3FA62B-6F58-4B86-9453-4D149940A066} 10.0.15063.0 - diff --git a/Source/Core/DolphinQt2/Info.plist.in b/Source/Core/DolphinQt2/Info.plist.in index 5e682e18a8..08fcfc511f 100644 --- a/Source/Core/DolphinQt2/Info.plist.in +++ b/Source/Core/DolphinQt2/Info.plist.in @@ -26,7 +26,7 @@ CFBundleExecutable - dolphin-emu-qt2 + Dolphin CFBundleIconFile Dolphin.icns CFBundleIdentifier diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 8ce2d700bf..46360d332f 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -2,7 +2,7 @@ if(NOT wxWidgets_FOUND) return() endif() -add_executable(dolphin-emu +add_executable(dolphin-emu-wx AboutDolphin.cpp ControllerConfigDiag.cpp Cheats/ActionReplayCodesPanel.cpp @@ -83,7 +83,7 @@ add_executable(dolphin-emu WxUtils.cpp ) -target_link_libraries(dolphin-emu +target_link_libraries(dolphin-emu-wx PRIVATE bdisasm core @@ -95,22 +95,24 @@ PRIVATE if(APPLE) # Add resource files to application bundle. 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 MACOSX_PACKAGE_LOCATION Resources) endif() if(WIN32) - target_sources(dolphin-emu PRIVATE + target_sources(dolphin-emu-wx PRIVATE DolphinWX.manifest DolphinWX.rc ) endif() +target_link_libraries(dolphin-emu-wx PRIVATE ${LIBS}) + if(USE_X11) find_package(GTK2 REQUIRED) - target_link_libraries(dolphin-emu PRIVATE ${GTK2_LIBRARIES}) - target_include_directories(dolphin-emu PRIVATE ${GTK2_INCLUDE_DIRS}) + target_link_libraries(dolphin-emu-wx PRIVATE ${GTK2_LIBRARIES}) + target_include_directories(dolphin-emu-wx PRIVATE ${GTK2_INCLUDE_DIRS}) endif() # 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") 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\\\\Generated" FILES ${pot_file}) foreach(po ${LINGUAS}) get_filename_component(lang ${po} NAME_WE) 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}) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") @@ -147,18 +149,21 @@ if(GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE) endif() if(APPLE) + include(BundleUtilities) + set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DolphinWx.app) + # Ask for an application bundle. - set_target_properties(dolphin-emu PROPERTIES + set_target_properties(dolphin-emu-wx PROPERTIES MACOSX_BUNDLE true MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in - OUTPUT_NAME Dolphin + OUTPUT_NAME DolphinWx ) # Copy resources in the bundle 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/*") 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) set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${resdir}") @@ -167,19 +172,19 @@ if(APPLE) # Update library references to make the bundle portable include(DolphinPostprocessBundle) - dolphin_postprocess_bundle(dolphin-emu) + dolphin_postprocess_bundle(dolphin-emu-wx) # Install bundle into systemwide /Applications directory. - install(TARGETS dolphin-emu DESTINATION /Applications) + install(TARGETS dolphin-emu-wx DESTINATION /Applications) elseif(WIN32) - set_target_properties(dolphin-emu PROPERTIES + set_target_properties(dolphin-emu-wx PROPERTIES WIN32_EXECUTABLE ON ) - add_custom_command(TARGET dolphin-emu - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $/Sys + add_custom_command(TARGET dolphin-emu-wx + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $/Sys ) else() - install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir}) + install(TARGETS dolphin-emu-wx RUNTIME DESTINATION ${bindir}) endif() -set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-emu) +set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-emu-wx) diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index 5b334899cf..2406585498 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -12,7 +12,7 @@ {47411FDB-1BF2-48D0-AB4E-C7C41160F898} - Dolphin + DolphinWx 10.0.15063.0 diff --git a/Source/Core/DolphinWX/Info.plist.in b/Source/Core/DolphinWX/Info.plist.in index 35122322f4..d03927479d 100644 --- a/Source/Core/DolphinWX/Info.plist.in +++ b/Source/Core/DolphinWX/Info.plist.in @@ -26,7 +26,7 @@ CFBundleExecutable - Dolphin + DolphinWx CFBundleIconFile Dolphin.icns CFBundleIdentifier