2023-09-10 07:27:45 +00:00
|
|
|
include(CopyBaseTranslations)
|
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
2020-07-28 09:16:12 +00:00
|
|
|
set(SRCS
|
2020-06-24 15:31:23 +00:00
|
|
|
resources/resources.qrc
|
2020-06-11 04:36:48 +00:00
|
|
|
aboutdialog.cpp
|
|
|
|
aboutdialog.h
|
2022-07-11 13:03:29 +00:00
|
|
|
aboutdialog.ui
|
2023-09-16 04:39:13 +00:00
|
|
|
achievementlogindialog.cpp
|
|
|
|
achievementlogindialog.h
|
|
|
|
achievementlogindialog.ui
|
|
|
|
achievementsettingswidget.cpp
|
|
|
|
achievementsettingswidget.h
|
|
|
|
achievementsettingswidget.ui
|
2020-04-30 14:59:31 +00:00
|
|
|
advancedsettingswidget.cpp
|
|
|
|
advancedsettingswidget.h
|
|
|
|
advancedsettingswidget.ui
|
2020-01-24 04:51:13 +00:00
|
|
|
audiosettingswidget.cpp
|
|
|
|
audiosettingswidget.h
|
|
|
|
audiosettingswidget.ui
|
2020-08-06 12:08:22 +00:00
|
|
|
autoupdaterdialog.cpp
|
|
|
|
autoupdaterdialog.h
|
|
|
|
autoupdaterdialog.ui
|
2020-09-22 13:08:07 +00:00
|
|
|
biossettingswidget.cpp
|
|
|
|
biossettingswidget.h
|
|
|
|
biossettingswidget.ui
|
2020-10-19 15:14:49 +00:00
|
|
|
cheatcodeeditordialog.cpp
|
|
|
|
cheatcodeeditordialog.h
|
|
|
|
cheatcodeeditordialog.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
cheatmanagerdialog.cpp
|
|
|
|
cheatmanagerdialog.h
|
|
|
|
cheatmanagerdialog.ui
|
2021-05-15 17:23:26 +00:00
|
|
|
collapsiblewidget.cpp
|
|
|
|
collapsiblewidget.h
|
2023-01-15 06:40:35 +00:00
|
|
|
colorpickerbutton.cpp
|
|
|
|
colorpickerbutton.h
|
2019-12-31 06:17:17 +00:00
|
|
|
consolesettingswidget.cpp
|
|
|
|
consolesettingswidget.h
|
|
|
|
consolesettingswidget.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
controllerbindingwidget_analog_controller.ui
|
|
|
|
controllerbindingwidget_analog_joystick.ui
|
|
|
|
controllerbindingwidget_digital_controller.ui
|
|
|
|
controllerbindingwidget_guncon.ui
|
2022-08-10 05:54:38 +00:00
|
|
|
controllerbindingwidget_mouse.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
controllerbindingwidget_negcon.ui
|
|
|
|
controllerbindingwidgets.cpp
|
|
|
|
controllerbindingwidgets.h
|
|
|
|
controllerbindingwidget.ui
|
|
|
|
controllerglobalsettingswidget.cpp
|
|
|
|
controllerglobalsettingswidget.h
|
|
|
|
controllerglobalsettingswidget.ui
|
2023-01-15 06:40:35 +00:00
|
|
|
controllerledsettingsdialog.ui
|
2022-08-05 11:49:13 +00:00
|
|
|
controllermacroeditwidget.ui
|
|
|
|
controllermacrowidget.ui
|
2023-11-06 13:01:38 +00:00
|
|
|
controllersettingswindow.cpp
|
|
|
|
controllersettingswindow.h
|
|
|
|
controllersettingswindow.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
controllersettingwidgetbinder.h
|
2022-09-13 10:29:17 +00:00
|
|
|
coverdownloaddialog.cpp
|
|
|
|
coverdownloaddialog.h
|
|
|
|
coverdownloaddialog.ui
|
2020-12-16 15:18:13 +00:00
|
|
|
debuggermodels.cpp
|
|
|
|
debuggermodels.h
|
|
|
|
debuggerwindow.cpp
|
|
|
|
debuggerwindow.h
|
|
|
|
debuggerwindow.ui
|
2020-09-10 14:18:12 +00:00
|
|
|
displaysettingswidget.cpp
|
|
|
|
displaysettingswidget.h
|
|
|
|
displaysettingswidget.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
displaywidget.cpp
|
|
|
|
displaywidget.h
|
|
|
|
emptygamelistwidget.ui
|
2021-01-23 07:33:36 +00:00
|
|
|
emulationsettingswidget.cpp
|
|
|
|
emulationsettingswidget.h
|
|
|
|
emulationsettingswidget.ui
|
2020-09-10 14:18:12 +00:00
|
|
|
enhancementsettingswidget.cpp
|
|
|
|
enhancementsettingswidget.h
|
|
|
|
enhancementsettingswidget.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
foldersettingswidget.cpp
|
|
|
|
foldersettingswidget.h
|
|
|
|
foldersettingswidget.ui
|
2020-08-01 16:57:12 +00:00
|
|
|
gamelistmodel.cpp
|
|
|
|
gamelistmodel.h
|
2022-07-11 13:03:29 +00:00
|
|
|
gamelistrefreshthread.cpp
|
|
|
|
gamelistrefreshthread.h
|
2020-08-01 17:03:25 +00:00
|
|
|
gamelistsearchdirectoriesmodel.cpp
|
|
|
|
gamelistsearchdirectoriesmodel.h
|
2019-12-31 06:17:17 +00:00
|
|
|
gamelistsettingswidget.cpp
|
|
|
|
gamelistsettingswidget.h
|
|
|
|
gamelistsettingswidget.ui
|
|
|
|
gamelistwidget.cpp
|
|
|
|
gamelistwidget.h
|
2022-07-11 13:03:29 +00:00
|
|
|
gamelistwidget.ui
|
|
|
|
gamesummarywidget.cpp
|
|
|
|
gamesummarywidget.h
|
|
|
|
gamesummarywidget.ui
|
2020-12-17 17:32:29 +00:00
|
|
|
gdbconnection.cpp
|
|
|
|
gdbconnection.h
|
|
|
|
gdbserver.cpp
|
|
|
|
gdbserver.h
|
2020-03-22 03:16:32 +00:00
|
|
|
generalsettingswidget.cpp
|
|
|
|
generalsettingswidget.h
|
|
|
|
generalsettingswidget.ui
|
2020-01-05 02:46:03 +00:00
|
|
|
hotkeysettingswidget.cpp
|
|
|
|
hotkeysettingswidget.h
|
2020-07-22 16:35:15 +00:00
|
|
|
inputbindingdialog.cpp
|
|
|
|
inputbindingdialog.h
|
|
|
|
inputbindingdialog.ui
|
2020-01-05 02:46:03 +00:00
|
|
|
inputbindingwidgets.cpp
|
|
|
|
inputbindingwidgets.h
|
2023-09-30 04:40:50 +00:00
|
|
|
logwindow.cpp
|
|
|
|
logwindow.h
|
2019-12-31 06:17:17 +00:00
|
|
|
mainwindow.cpp
|
|
|
|
mainwindow.h
|
|
|
|
mainwindow.ui
|
2020-09-18 14:28:07 +00:00
|
|
|
memorycardeditordialog.cpp
|
|
|
|
memorycardeditordialog.h
|
|
|
|
memorycardeditordialog.ui
|
2020-05-20 13:26:24 +00:00
|
|
|
memorycardsettingswidget.cpp
|
|
|
|
memorycardsettingswidget.h
|
2020-12-16 15:18:13 +00:00
|
|
|
memoryviewwidget.cpp
|
|
|
|
memoryviewwidget.h
|
2020-09-13 12:24:20 +00:00
|
|
|
postprocessingsettingswidget.cpp
|
|
|
|
postprocessingsettingswidget.h
|
|
|
|
postprocessingsettingswidget.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
qthost.cpp
|
|
|
|
qthost.h
|
|
|
|
qtkeycodes.cpp
|
2020-03-12 05:32:15 +00:00
|
|
|
qtprogresscallback.cpp
|
|
|
|
qtprogresscallback.h
|
2022-08-18 13:20:03 +00:00
|
|
|
qttranslations.cpp
|
2019-12-31 06:17:17 +00:00
|
|
|
qtutils.cpp
|
|
|
|
qtutils.h
|
2022-07-11 13:03:29 +00:00
|
|
|
resource.h
|
2023-11-06 13:01:38 +00:00
|
|
|
settingswindow.cpp
|
|
|
|
settingswindow.h
|
|
|
|
settingswindow.ui
|
2022-07-11 13:03:29 +00:00
|
|
|
settingwidgetbinder.h
|
2023-09-02 07:27:34 +00:00
|
|
|
setupwizarddialog.cpp
|
|
|
|
setupwizarddialog.h
|
|
|
|
setupwizarddialog.ui
|
2019-12-31 06:17:17 +00:00
|
|
|
)
|
|
|
|
|
2020-07-28 09:16:12 +00:00
|
|
|
set(TS_FILES
|
2020-08-03 03:27:20 +00:00
|
|
|
translations/duckstation-qt_de.ts
|
2021-03-02 19:11:40 +00:00
|
|
|
translations/duckstation-qt_en.ts
|
2020-08-15 01:37:45 +00:00
|
|
|
translations/duckstation-qt_es.ts
|
2023-09-16 12:22:18 +00:00
|
|
|
translations/duckstation-qt_es-ES.ts
|
2020-12-24 20:01:33 +00:00
|
|
|
translations/duckstation-qt_fr.ts
|
2020-08-14 14:12:47 +00:00
|
|
|
translations/duckstation-qt_he.ts
|
2020-08-17 01:54:10 +00:00
|
|
|
translations/duckstation-qt_it.ts
|
2020-12-24 20:01:33 +00:00
|
|
|
translations/duckstation-qt_ja.ts
|
2023-08-19 12:47:49 +00:00
|
|
|
translations/duckstation-qt_ko.ts
|
2020-12-24 20:01:33 +00:00
|
|
|
translations/duckstation-qt_nl.ts
|
2021-01-04 14:32:41 +00:00
|
|
|
translations/duckstation-qt_pl.ts
|
2023-09-16 12:22:18 +00:00
|
|
|
translations/duckstation-qt_pt-BR.ts
|
|
|
|
translations/duckstation-qt_pt-PT.ts
|
2020-12-24 20:01:33 +00:00
|
|
|
translations/duckstation-qt_ru.ts
|
2021-06-01 17:03:19 +00:00
|
|
|
translations/duckstation-qt_tr.ts
|
2023-09-16 12:22:18 +00:00
|
|
|
translations/duckstation-qt_zh-CN.ts
|
2020-07-28 09:16:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(duckstation-qt ${SRCS} ${QM_FILES})
|
2023-09-02 03:41:41 +00:00
|
|
|
target_precompile_headers(duckstation-qt PRIVATE "pch.h")
|
2022-07-11 13:03:29 +00:00
|
|
|
target_include_directories(duckstation-qt PRIVATE "${Qt6Gui_PRIVATE_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}")
|
2023-08-22 08:36:16 +00:00
|
|
|
target_link_libraries(duckstation-qt PRIVATE core common imgui minizip scmversion Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network)
|
2020-01-07 05:54:37 +00:00
|
|
|
|
2023-09-10 04:14:27 +00:00
|
|
|
# Our Qt builds may have exceptions on, so force them off.
|
|
|
|
target_compile_definitions(duckstation-qt PRIVATE QT_NO_EXCEPTIONS)
|
|
|
|
|
|
|
|
add_core_resources(duckstation-qt)
|
|
|
|
|
2020-01-07 05:54:37 +00:00
|
|
|
if(WIN32)
|
2023-09-02 03:41:41 +00:00
|
|
|
target_sources(duckstation-qt PRIVATE duckstation-qt.rc)
|
|
|
|
|
2020-05-16 03:10:31 +00:00
|
|
|
# We want a Windows subsystem application not console.
|
|
|
|
set_target_properties(duckstation-qt PROPERTIES
|
|
|
|
WIN32_EXECUTABLE TRUE
|
|
|
|
DEBUG_POSTFIX "-debug")
|
|
|
|
|
|
|
|
# Copy in Qt DLLs. Borrowed from Dolphin.
|
2022-07-11 13:03:29 +00:00
|
|
|
get_target_property(MOC_EXECUTABLE_LOCATION Qt6::moc IMPORTED_LOCATION)
|
2020-05-16 03:10:31 +00:00
|
|
|
get_filename_component(QT_BINARY_DIRECTORY "${MOC_EXECUTABLE_LOCATION}" DIRECTORY)
|
|
|
|
find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BINARY_DIRECTORY}")
|
|
|
|
add_custom_command(TARGET duckstation-qt POST_BUILD
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E env PATH="${QT_BINARY_DIRECTORY}"
|
|
|
|
"${WINDEPLOYQT_EXE}" --libdir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
|
|
|
--plugindir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/QtPlugins"
|
|
|
|
$<IF:$<CONFIG:Debug>,--debug,--release>
|
|
|
|
--no-translations
|
|
|
|
--no-compiler-runtime
|
|
|
|
"$<TARGET_FILE:duckstation-qt>"
|
|
|
|
)
|
|
|
|
add_custom_command(TARGET duckstation-qt POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.win" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
|
|
|
|
)
|
2023-09-10 04:14:27 +00:00
|
|
|
#set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/translations")
|
|
|
|
elseif(APPLE)
|
|
|
|
# Don't generate a bundle for XCode, it makes code signing fail...
|
|
|
|
if(NOT CMAKE_GENERATOR MATCHES "Xcode")
|
|
|
|
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DuckStation.app)
|
|
|
|
set_target_properties(duckstation-qt PROPERTIES
|
|
|
|
MACOSX_BUNDLE true
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
|
|
|
|
OUTPUT_NAME DuckStation
|
|
|
|
)
|
|
|
|
|
|
|
|
# Inject Qt Libraries into bundle.
|
|
|
|
if(NOT SKIP_POSTPROCESS_BUNDLE)
|
|
|
|
find_program(MACDEPLOYQT_EXE macdeployqt HINTS "${QT_BINARY_DIRECTORY}")
|
|
|
|
add_custom_target(duckstation-postprocess-bundle ALL
|
|
|
|
COMMAND "${MACDEPLOYQT_EXE}" "${BUNDLE_PATH}" -no-strip
|
|
|
|
)
|
|
|
|
add_dependencies(duckstation-postprocess-bundle duckstation-qt)
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-08-25 12:04:55 +00:00
|
|
|
|
|
|
|
# Copy icon into the bundle
|
|
|
|
target_sources(duckstation-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns")
|
|
|
|
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
|
|
|
2023-09-10 04:14:27 +00:00
|
|
|
# Translation setup
|
|
|
|
qt_add_lrelease(duckstation-qt TS_FILES ${TS_FILES} QM_FILES_OUTPUT_VARIABLE QM_FILES)
|
2023-09-10 07:27:45 +00:00
|
|
|
foreach (QM_FILE IN LISTS QM_FILES)
|
|
|
|
target_sources(duckstation-qt PRIVATE ${QM_FILE})
|
|
|
|
set_source_files_properties(${QM_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/translations)
|
|
|
|
endforeach()
|
|
|
|
copy_base_translations(duckstation-qt)
|
2023-09-10 04:14:27 +00:00
|
|
|
else()
|
2023-09-10 07:27:45 +00:00
|
|
|
qt_add_lrelease(duckstation-qt TS_FILES ${TS_FILES} QM_FILES_OUTPUT_VARIABLE QM_FILES)
|
|
|
|
set(QM_OUTPUT_DIR "$<TARGET_FILE_DIR:duckstation-qt>/translations")
|
|
|
|
add_custom_command(TARGET duckstation-qt POST_BUILD COMMAND "${CMAKE_COMMAND}" -E make_directory "${QM_OUTPUT_DIR}")
|
|
|
|
foreach (QM_FILE IN LISTS QM_FILES)
|
|
|
|
get_filename_component(QM_FILE_NAME ${QM_FILE} NAME)
|
|
|
|
add_custom_command(TARGET duckstation-qt POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${QM_FILE}" "${QM_OUTPUT_DIR}/${QM_FILE_NAME}")
|
|
|
|
endforeach()
|
|
|
|
copy_base_translations(duckstation-qt)
|
2020-08-25 12:04:55 +00:00
|
|
|
endif()
|