Skip to content

Commit

Permalink
Qt/Wx: Turn Qt into the default interface
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Jan 26, 2018
1 parent 9a6644d commit 25986c7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,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 Qt2 (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)
Expand Down
11 changes: 5 additions & 6 deletions Source/Core/DolphinQt2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if(WIN32)
list(APPEND SRCS DolphinQt2.manifest)
endif()

set(DOLPHINQT2_BINARY dolphin-emu-qt2)
set(DOLPHINQT2_BINARY dolphin-emu)

add_executable(${DOLPHINQT2_BINARY} ${SRCS} ${UI_HEADERS})
target_link_libraries(${DOLPHINQT2_BINARY} ${LIBS} Qt5::Widgets)
Expand All @@ -120,7 +120,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})

Expand All @@ -129,7 +129,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")
Expand All @@ -148,15 +148,14 @@ 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}/${DOLPHINQT2_BINARY}.app)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app)

# Ask for an application bundle.
set_target_properties(${DOLPHINQT2_BINARY} PROPERTIES
MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
OUTPUT_NAME Dolphin
)

# Copy qt.conf into the bundle
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/DolphinQt2/DolphinQt2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{FA3FA62B-6F58-4B86-9453-4D149940A066}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
<!--
Enable this once wxwidgets is completely removed
<ProjectName>Dolphin</ProjectName>
-->
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
Expand Down
35 changes: 19 additions & 16 deletions Source/Core/DolphinWX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ if(WIN32)
)
endif()

add_executable(dolphin-emu ${SRCS})
target_link_libraries(dolphin-emu PRIVATE ${LIBS})
add_executable(dolphin-emu-wx ${SRCS})
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
Expand All @@ -121,7 +121,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 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})

Expand All @@ -130,7 +130,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 PRIVATE ${mo})
target_sources(dolphin-emu-wx PRIVATE ${mo})
source_group("Localization\\\\Generated" FILES ${mo})

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
Expand All @@ -149,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}")
Expand All @@ -169,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 $<TARGET_FILE_DIR:dolphin-emu>/Sys
add_custom_command(TARGET dolphin-emu-wx
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $<TARGET_FILE_DIR:dolphin-emu-wx>/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)
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/DolphinWX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{47411FDB-1BF2-48D0-AB4E-C7C41160F898}</ProjectGuid>
<ProjectName>Dolphin</ProjectName>
<ProjectName>DolphinWx</ProjectName>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Expand Down

0 comments on commit 25986c7

Please sign in to comment.