2017-09-04 17:35:38 +00:00
|
|
|
find_package(Qt5Widgets)
|
|
|
|
find_package(Qt5Gui)
|
|
|
|
|
|
|
|
if(NOT Qt5Widgets_FOUND OR NOT Qt5Gui_FOUND)
|
|
|
|
message(FATAL_ERROR "Could not find Qt5, which is required to build the DolphinQt2 frontend. If you don't want to build the Qt frontend, pass -DENABLE_QT2=False to
|
|
|
|
CMake.")
|
|
|
|
endif()
|
|
|
|
|
2017-06-03 22:47:13 +00:00
|
|
|
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES "")
|
2017-01-26 13:00:28 +00:00
|
|
|
message(STATUS "Found Qt version ${Qt5Core_VERSION}")
|
|
|
|
|
2015-11-27 08:33:07 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2017-06-15 23:42:12 +00:00
|
|
|
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
|
|
|
|
2015-11-27 08:33:07 +00:00
|
|
|
add_definitions(-DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
|
|
|
set(SRCS
|
2017-03-01 12:43:43 +00:00
|
|
|
AboutDialog.cpp
|
2017-08-30 14:44:28 +00:00
|
|
|
FIFOPlayerWindow.cpp
|
2017-06-06 11:49:49 +00:00
|
|
|
HotkeyScheduler.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
Host.cpp
|
|
|
|
InDevelopmentWarning.cpp
|
|
|
|
Main.cpp
|
|
|
|
MainWindow.cpp
|
|
|
|
MenuBar.cpp
|
|
|
|
RenderWidget.cpp
|
|
|
|
Resources.cpp
|
|
|
|
Settings.cpp
|
|
|
|
ToolBar.cpp
|
2017-07-17 21:50:40 +00:00
|
|
|
Translation.cpp
|
2017-06-14 09:58:11 +00:00
|
|
|
WiiUpdate.cpp
|
|
|
|
WiiUpdate.h
|
2017-09-10 17:10:45 +00:00
|
|
|
Config/CheatWarningWidget.cpp
|
2017-05-09 16:49:10 +00:00
|
|
|
Config/ControllersWindow.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
Config/FilesystemWidget.cpp
|
2017-09-10 17:10:45 +00:00
|
|
|
Config/GeckoCodeWidget.cpp
|
2017-06-15 23:42:12 +00:00
|
|
|
Config/Graphics/AdvancedWidget.cpp
|
|
|
|
Config/Graphics/EnhancementsWidget.cpp
|
|
|
|
Config/Graphics/GeneralWidget.cpp
|
|
|
|
Config/Graphics/HacksWidget.cpp
|
|
|
|
Config/Graphics/GraphicsBool.cpp
|
|
|
|
Config/Graphics/GraphicsChoice.cpp
|
|
|
|
Config/Graphics/GraphicsSlider.cpp
|
|
|
|
Config/Graphics/GraphicsWidget.cpp
|
|
|
|
Config/Graphics/GraphicsWindow.cpp
|
2017-06-15 23:43:14 +00:00
|
|
|
Config/Graphics/SoftwareRendererWidget.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
Config/InfoWidget.cpp
|
2017-08-27 22:10:06 +00:00
|
|
|
Config/LogConfigWidget.cpp
|
|
|
|
Config/LogWidget.cpp
|
2017-05-20 15:53:17 +00:00
|
|
|
Config/Mapping/GCKeyboardEmu.cpp
|
|
|
|
Config/Mapping/GCPadEmu.cpp
|
2017-11-05 01:45:37 +00:00
|
|
|
Config/Mapping/GCPadWiiUConfigDialog.cpp
|
2017-06-06 11:49:49 +00:00
|
|
|
Config/Mapping/Hotkey3D.cpp
|
|
|
|
Config/Mapping/HotkeyGeneral.cpp
|
|
|
|
Config/Mapping/HotkeyGraphics.cpp
|
|
|
|
Config/Mapping/HotkeyStates.cpp
|
|
|
|
Config/Mapping/HotkeyTAS.cpp
|
|
|
|
Config/Mapping/HotkeyWii.cpp
|
2017-06-13 15:16:41 +00:00
|
|
|
Config/Mapping/IOWindow.cpp
|
2017-05-20 15:53:17 +00:00
|
|
|
Config/Mapping/MappingBool.cpp
|
|
|
|
Config/Mapping/MappingButton.cpp
|
2017-06-13 15:16:41 +00:00
|
|
|
Config/Mapping/MappingCommon.cpp
|
2017-05-20 15:53:17 +00:00
|
|
|
Config/Mapping/MappingNumeric.cpp
|
|
|
|
Config/Mapping/MappingWidget.cpp
|
|
|
|
Config/Mapping/MappingWindow.cpp
|
|
|
|
Config/Mapping/WiimoteEmuExtension.cpp
|
|
|
|
Config/Mapping/WiimoteEmuGeneral.cpp
|
|
|
|
Config/Mapping/WiimoteEmuMotionControl.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
Config/PropertiesDialog.cpp
|
|
|
|
Config/SettingsWindow.cpp
|
2017-08-14 14:05:46 +00:00
|
|
|
GameList/GameFileCache.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
GameList/GameFile.cpp
|
|
|
|
GameList/GameList.cpp
|
|
|
|
GameList/GameListModel.cpp
|
|
|
|
GameList/GameTracker.cpp
|
2017-08-05 08:28:53 +00:00
|
|
|
GameList/GridProxyModel.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
GameList/ListProxyModel.cpp
|
2017-06-27 05:44:10 +00:00
|
|
|
QtUtils/BlockUserInputFilter.cpp
|
2017-07-21 20:48:21 +00:00
|
|
|
NetPlay/GameListDialog.cpp
|
|
|
|
NetPlay/MD5Dialog.cpp
|
|
|
|
NetPlay/NetPlayDialog.cpp
|
|
|
|
NetPlay/NetPlaySetupDialog.cpp
|
|
|
|
NetPlay/PadMappingDialog.cpp
|
2017-05-31 07:16:23 +00:00
|
|
|
QtUtils/DoubleClickEventFilter.cpp
|
2017-05-31 06:08:14 +00:00
|
|
|
QtUtils/ElidedButton.cpp
|
2017-07-16 21:25:36 +00:00
|
|
|
QtUtils/ListTabWidget.cpp
|
2017-06-15 01:49:56 +00:00
|
|
|
QtUtils/WindowActivationEventFilter.cpp
|
2017-06-28 04:36:27 +00:00
|
|
|
Settings/AdvancedPane.cpp
|
2017-06-21 08:27:21 +00:00
|
|
|
Settings/AudioPane.cpp
|
2017-05-04 04:19:51 +00:00
|
|
|
Settings/GeneralPane.cpp
|
2017-05-04 07:47:59 +00:00
|
|
|
Settings/InterfacePane.cpp
|
2017-05-31 08:08:04 +00:00
|
|
|
Settings/PathPane.cpp
|
2017-03-01 12:43:43 +00:00
|
|
|
)
|
2015-11-27 08:33:07 +00:00
|
|
|
|
|
|
|
list(APPEND LIBS core uicommon)
|
|
|
|
|
2017-02-10 07:46:23 +00:00
|
|
|
if(WIN32)
|
2017-03-01 12:43:43 +00:00
|
|
|
list(APPEND SRCS DolphinQt2.manifest)
|
2017-02-10 07:46:23 +00:00
|
|
|
endif()
|
|
|
|
|
2015-11-27 08:33:07 +00:00
|
|
|
set(DOLPHINQT2_BINARY dolphin-emu-qt2)
|
|
|
|
|
|
|
|
add_executable(${DOLPHINQT2_BINARY} ${SRCS} ${UI_HEADERS})
|
|
|
|
target_link_libraries(${DOLPHINQT2_BINARY} ${LIBS} Qt5::Widgets)
|
|
|
|
|
2017-07-17 21:50:40 +00:00
|
|
|
# Handle localization
|
|
|
|
find_package(Gettext)
|
|
|
|
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})
|
|
|
|
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)
|
|
|
|
|
|
|
|
target_sources(dolphin-emu-qt2 PRIVATE ${mo})
|
|
|
|
source_group("Localization\\\\Generated" FILES ${mo})
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
set_source_files_properties(${mo} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/${lang}.lproj")
|
|
|
|
else()
|
|
|
|
install(FILES ${mo} DESTINATION share/locale/${lang}/LC_MESSAGES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${mo}
|
|
|
|
COMMAND mkdir -p ${mo_dir}
|
|
|
|
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${po} ${pot_file}
|
|
|
|
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo} ${po}
|
|
|
|
DEPENDS ${po}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2016-05-04 06:25:53 +00:00
|
|
|
if(APPLE)
|
2017-03-01 12:43:43 +00:00
|
|
|
# Note: This is copied from DolphinQt, based on the DolphinWX version.
|
2016-05-04 06:25:53 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
include(BundleUtilities)
|
|
|
|
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DOLPHINQT2_BINARY}.app)
|
2016-05-04 06:25:53 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
# 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
|
|
|
|
)
|
2016-05-04 06:25:53 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
# Copy qt.conf into the bundle
|
|
|
|
target_sources(${DOLPHINQT2_BINARY} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
|
|
|
|
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
2017-02-04 00:10:59 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
# Copy Qt plugins into the bundle
|
|
|
|
get_target_property(qtcocoa_location Qt5::QCocoaIntegrationPlugin LOCATION)
|
|
|
|
target_sources(${DOLPHINQT2_BINARY} PRIVATE "${qtcocoa_location}")
|
|
|
|
set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms)
|
2017-02-02 02:51:00 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
# 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(${DOLPHINQT2_BINARY} 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}")
|
|
|
|
source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}")
|
|
|
|
endforeach()
|
2017-02-04 00:10:59 +00:00
|
|
|
|
2017-03-01 12:43:43 +00:00
|
|
|
# Update library references to make the bundle portable
|
|
|
|
include(DolphinPostprocessBundle)
|
|
|
|
dolphin_postprocess_bundle(${DOLPHINQT2_BINARY})
|
2016-05-04 06:25:53 +00:00
|
|
|
else()
|
2017-03-01 12:43:43 +00:00
|
|
|
install(TARGETS ${DOLPHINQT2_BINARY} RUNTIME DESTINATION ${bindir})
|
2016-05-04 06:25:53 +00:00
|
|
|
endif()
|