2021-11-25 10:20:56 +01:00
|
|
|
# Find includes in corresponding build directories
|
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
|
2021-11-28 20:54:32 +01:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
2021-12-13 22:45:37 +01:00
|
|
|
add_library(plat STATIC
|
|
|
|
|
qt.c
|
|
|
|
|
qt_main.cpp
|
|
|
|
|
qt_platform.cpp
|
|
|
|
|
sdl_joystick.cpp
|
|
|
|
|
)
|
2021-12-17 21:33:11 +02:00
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
add_library(ui STATIC
|
|
|
|
|
qt_ui.cpp
|
|
|
|
|
qt_cdrom.c
|
|
|
|
|
|
|
|
|
|
qt_mainwindow.cpp
|
|
|
|
|
qt_mainwindow.hpp
|
|
|
|
|
qt_mainwindow.ui
|
2021-11-28 20:49:05 +01:00
|
|
|
qt_machinestatus.cpp
|
|
|
|
|
qt_machinestatus.hpp
|
2021-12-03 11:38:00 +01:00
|
|
|
qt_mediamenu.cpp
|
|
|
|
|
qt_mediamenu.hpp
|
2021-12-04 21:33:04 +01:00
|
|
|
qt_rendererstack.cpp
|
|
|
|
|
qt_rendererstack.hpp
|
|
|
|
|
qt_rendererstack.ui
|
2021-12-07 13:47:42 +01:00
|
|
|
qt_renderercomon.cpp
|
|
|
|
|
qt_renderercomon.hpp
|
2021-12-04 21:33:04 +01:00
|
|
|
qt_softwarerenderer.cpp
|
|
|
|
|
qt_softwarerenderer.hpp
|
|
|
|
|
qt_hardwarerenderer.cpp
|
|
|
|
|
qt_hardwarerenderer.hpp
|
2021-11-30 16:26:49 +06:00
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
qt_settings.cpp
|
|
|
|
|
qt_settings.hpp
|
|
|
|
|
qt_settings.ui
|
|
|
|
|
|
|
|
|
|
qt_settingsmachine.cpp
|
|
|
|
|
qt_settingsmachine.hpp
|
|
|
|
|
qt_settingsmachine.ui
|
|
|
|
|
qt_settingsdisplay.cpp
|
|
|
|
|
qt_settingsdisplay.hpp
|
|
|
|
|
qt_settingsdisplay.ui
|
|
|
|
|
qt_settingsinput.cpp
|
|
|
|
|
qt_settingsinput.hpp
|
|
|
|
|
qt_settingsinput.ui
|
|
|
|
|
qt_settingssound.cpp
|
|
|
|
|
qt_settingssound.hpp
|
|
|
|
|
qt_settingssound.ui
|
|
|
|
|
qt_settingsnetwork.cpp
|
|
|
|
|
qt_settingsnetwork.hpp
|
|
|
|
|
qt_settingsnetwork.ui
|
|
|
|
|
qt_settingsports.cpp
|
|
|
|
|
qt_settingsports.hpp
|
|
|
|
|
qt_settingsports.ui
|
|
|
|
|
qt_settingsstoragecontrollers.cpp
|
|
|
|
|
qt_settingsstoragecontrollers.hpp
|
|
|
|
|
qt_settingsstoragecontrollers.ui
|
|
|
|
|
qt_settingsharddisks.cpp
|
|
|
|
|
qt_settingsharddisks.hpp
|
|
|
|
|
qt_settingsharddisks.ui
|
|
|
|
|
qt_settingsfloppycdrom.cpp
|
|
|
|
|
qt_settingsfloppycdrom.hpp
|
|
|
|
|
qt_settingsfloppycdrom.ui
|
|
|
|
|
qt_settingsotherremovable.cpp
|
|
|
|
|
qt_settingsotherremovable.hpp
|
|
|
|
|
qt_settingsotherremovable.ui
|
|
|
|
|
qt_settingsotherperipherals.cpp
|
|
|
|
|
qt_settingsotherperipherals.hpp
|
|
|
|
|
qt_settingsotherperipherals.ui
|
|
|
|
|
|
|
|
|
|
qt_deviceconfig.cpp
|
|
|
|
|
qt_deviceconfig.hpp
|
|
|
|
|
qt_deviceconfig.ui
|
2021-12-13 22:45:37 +01:00
|
|
|
qt_joystickconfiguration.cpp
|
|
|
|
|
qt_joystickconfiguration.hpp
|
|
|
|
|
qt_joystickconfiguration.ui
|
2021-11-25 10:20:56 +01:00
|
|
|
|
|
|
|
|
qt_filefield.cpp
|
|
|
|
|
qt_filefield.hpp
|
|
|
|
|
qt_filefield.ui
|
2021-12-03 11:38:00 +01:00
|
|
|
qt_newfloppydialog.cpp
|
|
|
|
|
qt_newfloppydialog.hpp
|
|
|
|
|
qt_newfloppydialog.ui
|
2021-11-25 10:20:56 +01:00
|
|
|
qt_harddiskdialog.cpp
|
|
|
|
|
qt_harddiskdialog.hpp
|
|
|
|
|
qt_harddiskdialog.ui
|
|
|
|
|
|
|
|
|
|
qt_harddrive_common.cpp
|
|
|
|
|
qt_harddrive_common.hpp
|
|
|
|
|
qt_models_common.cpp
|
|
|
|
|
qt_models_common.hpp
|
|
|
|
|
|
2021-12-12 01:16:27 +06:00
|
|
|
qt_specifydimensions.h
|
|
|
|
|
qt_specifydimensions.cpp
|
|
|
|
|
qt_specifydimensions.ui
|
2021-12-12 16:22:35 +06:00
|
|
|
qt_soundgain.hpp
|
|
|
|
|
qt_soundgain.cpp
|
|
|
|
|
qt_soundgain.ui
|
2021-12-12 01:16:27 +06:00
|
|
|
|
2021-12-12 18:19:44 +02:00
|
|
|
qt_styleoverride.cpp
|
|
|
|
|
qt_styleoverride.hpp
|
2021-12-28 16:47:10 +06:00
|
|
|
qt_progsettings.hpp
|
|
|
|
|
qt_progsettings.cpp
|
|
|
|
|
qt_progsettings.ui
|
2021-12-12 18:19:44 +02:00
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
../qt_resources.qrc
|
|
|
|
|
)
|
2021-12-17 21:33:11 +02:00
|
|
|
|
2021-12-20 21:54:25 +02:00
|
|
|
if(WIN32 AND NOT MINGW)
|
2021-12-19 23:49:47 +02:00
|
|
|
target_sources(plat PRIVATE ../win/win_opendir.c)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-11-30 20:18:13 +01:00
|
|
|
if (APPLE)
|
|
|
|
|
target_sources(ui PRIVATE macos_event_filter.mm)
|
|
|
|
|
endif()
|
2021-11-25 10:20:56 +01:00
|
|
|
|
2021-12-09 20:59:50 +02:00
|
|
|
if (WIN32)
|
|
|
|
|
target_sources(ui PRIVATE qt_winrawinputfilter.hpp qt_winrawinputfilter.cpp)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-11-25 10:20:56 +01:00
|
|
|
target_link_libraries(
|
|
|
|
|
plat
|
|
|
|
|
PRIVATE
|
|
|
|
|
Qt5::Widgets
|
2021-12-02 16:26:33 +06:00
|
|
|
Qt5::Gui
|
2021-11-28 20:54:32 +01:00
|
|
|
Threads::Threads
|
2021-11-25 10:20:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
ui
|
|
|
|
|
PRIVATE
|
|
|
|
|
Qt5::Widgets
|
2021-12-02 16:26:33 +06:00
|
|
|
Qt5::Gui
|
2021-11-28 20:54:32 +01:00
|
|
|
Threads::Threads
|
2021-11-25 10:20:56 +01:00
|
|
|
)
|
2021-11-30 16:26:49 +06:00
|
|
|
|
2021-12-06 17:31:25 +02:00
|
|
|
# needed for static builds
|
|
|
|
|
if (WIN32)
|
|
|
|
|
qt_import_plugins(plat INCLUDE Qt5::QWindowsIntegrationPlugin Qt5::QICOPlugin QWindowsVistaStylePlugin)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-11-30 20:18:13 +01:00
|
|
|
if (UNIX AND NOT APPLE)
|
2021-11-30 16:26:49 +06:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
|
target_link_libraries(ui PRIVATE X11::X11)
|
2021-12-10 01:03:20 +06:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
pkg_check_modules(LIBEVDEV IMPORTED_TARGET libevdev)
|
|
|
|
|
if (LIBEVDEV_FOUND)
|
|
|
|
|
target_compile_definitions(ui PRIVATE EVDEV_INPUT)
|
|
|
|
|
target_link_libraries(ui PUBLIC PkgConfig::LIBEVDEV)
|
|
|
|
|
target_sources(ui PRIVATE evdev_mouse.cpp)
|
|
|
|
|
endif()
|
2021-12-03 16:42:31 +06:00
|
|
|
|
2021-12-02 16:26:33 +06:00
|
|
|
find_package(ECM NO_MODULE)
|
|
|
|
|
if (ECM_FOUND)
|
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
|
|
|
|
find_package(Wayland COMPONENTS Client)
|
|
|
|
|
if (Wayland_FOUND)
|
|
|
|
|
target_link_libraries(ui PRIVATE Wayland::Client)
|
|
|
|
|
find_package(WaylandScanner REQUIRED)
|
|
|
|
|
if (WaylandScanner_FOUND)
|
|
|
|
|
set(WL_SOURCE_VAR)
|
|
|
|
|
ecm_add_wayland_client_protocol(WL_SOURCE_VAR PROTOCOL ${CMAKE_SOURCE_DIR}/wl_protocols/relative-pointer-unstable-v1.xml BASENAME relative-pointer-unstable-v1)
|
|
|
|
|
ecm_add_wayland_client_protocol(WL_SOURCE_VAR PROTOCOL ${CMAKE_SOURCE_DIR}/wl_protocols/pointer-constraints-unstable-v1.xml BASENAME pointer-constraints-unstable-v1)
|
|
|
|
|
target_include_directories(ui PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
|
|
|
|
target_sources(ui PRIVATE ${WL_SOURCE_VAR} wl_mouse.cpp)
|
|
|
|
|
target_compile_definitions(ui PRIVATE WAYLAND)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2021-11-30 20:18:13 +01:00
|
|
|
endif()
|
2021-12-31 12:36:55 +06:00
|
|
|
qt5_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} 86box_en.ts 86box_en-GB.ts 86box_de.ts 86box_es.ts 86box_fi.ts 86box_fr.ts 86box_hr.ts 86box_hu.ts 86box_it.ts 86box_ja.ts 86box_ko.ts 86box_pt-BR.ts 86box_pt-PT.ts 86box_ru.ts 86box_sl.ts 86box_tr.ts 86box_zh.ts)
|
|
|
|
|
configure_file(qt_translations.qrc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
|
|
|
|
|
target_sources(ui PRIVATE ${QM_FILES} ${CMAKE_CURRENT_BINARY_DIR}/qt_translations.qrc)
|