dolphin/Source/Core/DolphinQt2/CMakeLists.txt

218 lines
6.8 KiB
CMake
Raw Normal View History

find_package(Qt5 REQUIRED COMPONENTS Gui Widgets)
2017-09-04 17:35:38 +00:00
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES "")
message(STATUS "Found Qt version ${Qt5Core_VERSION}")
2015-11-27 08:33:07 +00:00
set(CMAKE_AUTOMOC ON)
add_executable(dolphin-emu
AboutDialog.cpp
2018-03-26 02:17:47 +00:00
CheatsManager.cpp
2017-08-30 14:44:28 +00:00
FIFOPlayerWindow.cpp
HotkeyScheduler.cpp
Host.cpp
Main.cpp
MainWindow.cpp
MenuBar.cpp
RenderWidget.cpp
Resources.cpp
2018-03-21 10:13:53 +00:00
SearchBar.cpp
Settings.cpp
ToolBar.cpp
2017-07-17 21:50:40 +00:00
Translation.cpp
WiiUpdate.cpp
WiiUpdate.h
Config/CheatCodeEditor.cpp
2018-01-01 20:01:58 +00:00
Config/ARCodeWidget.cpp
Config/CheatWarningWidget.cpp
2017-05-09 16:49:10 +00:00
Config/ControllersWindow.cpp
Config/FilesystemWidget.cpp
Config/GameConfigWidget.cpp
Config/GeckoCodeWidget.cpp
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/GraphicsRadio.cpp
Config/Graphics/GraphicsSlider.cpp
Config/Graphics/GraphicsWidget.cpp
Config/Graphics/GraphicsWindow.cpp
Config/Graphics/SoftwareRendererWidget.cpp
Config/InfoWidget.cpp
Config/LogConfigWidget.cpp
Config/LogWidget.cpp
2017-05-20 15:53:17 +00:00
Config/Mapping/GCKeyboardEmu.cpp
Config/Mapping/GCMicrophone.cpp
2017-05-20 15:53:17 +00:00
Config/Mapping/GCPadEmu.cpp
Config/Mapping/GCPadWiiUConfigDialog.cpp
Config/Mapping/Hotkey3D.cpp
2018-02-14 22:25:01 +00:00
Config/Mapping/HotkeyDebugging.cpp
Config/Mapping/HotkeyGeneral.cpp
Config/Mapping/HotkeyGraphics.cpp
Config/Mapping/HotkeyStates.cpp
Config/Mapping/HotkeyTAS.cpp
Config/Mapping/HotkeyWii.cpp
Config/Mapping/IOWindow.cpp
2017-05-20 15:53:17 +00:00
Config/Mapping/MappingBool.cpp
Config/Mapping/MappingButton.cpp
Config/Mapping/MappingCommon.cpp
2018-02-07 17:16:15 +00:00
Config/Mapping/MappingIndicator.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
Config/NewPatchDialog.cpp
Config/PatchesWidget.cpp
Config/PropertiesDialog.cpp
Config/SettingsWindow.cpp
Debugger/BreakpointWidget.cpp
2018-02-14 22:25:01 +00:00
Debugger/CodeViewWidget.cpp
Debugger/CodeWidget.cpp
2018-03-16 11:39:53 +00:00
Debugger/MemoryViewWidget.cpp
Debugger/MemoryWidget.cpp
Debugger/NewBreakpointDialog.cpp
Debugger/RegisterColumn.cpp
Debugger/RegisterWidget.cpp
2017-09-27 06:53:05 +00:00
Debugger/WatchWidget.cpp
GameList/GameList.cpp
GameList/GameListModel.cpp
GameList/GameTracker.cpp
GameList/GridProxyModel.cpp
GameList/ListProxyModel.cpp
2018-01-25 18:54:50 +00:00
GCMemcardManager.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
QtUtils/DoubleClickEventFilter.cpp
2017-05-31 06:08:14 +00:00
QtUtils/ElidedButton.cpp
QtUtils/ImageConverter.cpp
QtUtils/WindowActivationEventFilter.cpp
2018-03-26 06:13:15 +00:00
QtUtils/WinIconHelper.cpp
2018-03-17 15:07:51 +00:00
QtUtils/WrapInScrollArea.cpp
2018-01-27 13:35:02 +00:00
QtUtils/AspectRatioWidget.cpp
2017-06-28 04:36:27 +00:00
Settings/AdvancedPane.cpp
2017-06-21 08:27:21 +00:00
Settings/AudioPane.cpp
2018-01-04 00:41:31 +00:00
Settings/GameCubePane.cpp
Settings/GeneralPane.cpp
Settings/InterfacePane.cpp
Settings/PathPane.cpp
Settings/WiiPane.cpp
Settings/USBDeviceAddToWhitelistDialog.cpp
2018-01-27 13:35:02 +00:00
TAS/GCTASInputWindow.cpp
2018-01-31 11:35:09 +00:00
TAS/WiiTASInputWindow.cpp
TAS/Shared.cpp
2018-01-27 13:35:02 +00:00
TAS/StickWidget.cpp
2018-02-06 11:10:28 +00:00
TAS/IRWidget.cpp
2018-03-22 11:20:15 +00:00
Updater.cpp
)
2015-11-27 08:33:07 +00:00
target_compile_definitions(dolphin-emu
PRIVATE
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
)
target_include_directories(dolphin-emu
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
)
target_link_libraries(dolphin-emu
PRIVATE
core
Qt5::Widgets
uicommon
)
2015-11-27 08:33:07 +00:00
if(WIN32)
target_sources(dolphin-emu PRIVATE DolphinQt2.manifest)
endif()
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 PRIVATE ${pot_file} ${LINGUAS})
2017-07-17 21:50:40 +00:00
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 PRIVATE ${mo})
2017-07-17 21:50:40 +00:00
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 cmake -E make_directory ${mo_dir}
2017-07-17 21:50:40 +00:00
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${po} ${pot_file}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo} ${po}
DEPENDS ${po}
)
endforeach()
endif()
if(APPLE)
include(BundleUtilities)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app)
# Ask for an application bundle.
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 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
2018-02-24 20:12:22 +00:00
# Copy icon into the bundle
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns")
2018-02-24 20:12:22 +00:00
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 PRIVATE "${qtcocoa_location}")
set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms)
2018-02-24 17:48:29 +00:00
get_target_property(qtmacstyle_location Qt5::QMacStylePlugin LOCATION)
target_sources(dolphin-emu PRIVATE "${qtmacstyle_location}")
2018-02-24 17:48:29 +00:00
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 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()
# Update library references to make the bundle portable
include(DolphinPostprocessBundle)
dolphin_postprocess_bundle(dolphin-emu)
else()
install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir})
endif()