mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-29 15:07:45 +00:00
Launcher: Support launching Windows executables
This commit is contained in:
parent
dd2c3e4487
commit
3747e271f9
2 changed files with 37 additions and 8 deletions
|
@ -1,20 +1,47 @@
|
||||||
# SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
# SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
# config file used for app executable names
|
||||||
|
# TODO: haha this is horrible, make this easier pls
|
||||||
|
file (GENERATE
|
||||||
|
OUTPUT "launcherconfig_$<CONFIG>.h.out"
|
||||||
|
CONTENT "\
|
||||||
|
#pragma once\n\
|
||||||
|
#define GEAREDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-armoury>\")\n\
|
||||||
|
#define EXCELEDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-karuku>\")\n\
|
||||||
|
#define MAPEDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mapeditor>\")\n\
|
||||||
|
#define MATEDITOR_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mateditor>\")\n\
|
||||||
|
#define MDLVIEWER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-mdlviewer>\")\n\
|
||||||
|
#define DATAEXPLORER_EXECUTABLE QStringLiteral(\"$<TARGET_FILE_NAME:novus-sagasu>\")\n\
|
||||||
|
"
|
||||||
|
)
|
||||||
|
|
||||||
|
# copy the new file to something standard we'll plug into the C++
|
||||||
|
add_custom_command(
|
||||||
|
COMMAND ${CMAKE_COMMAND} "-E" "copy_if_different" "launcherconfig_$<CONFIG>.h.out" "launcherconfig.h"
|
||||||
|
VERBATIM
|
||||||
|
PRE_BUILD
|
||||||
|
DEPENDS "launcherconfig_$<CONFIG>.h.out"
|
||||||
|
OUTPUT "launcherconfig.h"
|
||||||
|
COMMENT "creating config.out file ({event: PRE_BUILD}, {filename: config.out})"
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(novus-launcher)
|
add_executable(novus-launcher)
|
||||||
target_sources(novus-launcher
|
target_sources(novus-launcher
|
||||||
PRIVATE
|
PRIVATE
|
||||||
include/mainwindow.h
|
include/mainwindow.h
|
||||||
|
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/mainwindow.cpp)
|
src/mainwindow.cpp
|
||||||
|
|
||||||
|
launcherconfig.h)
|
||||||
target_link_libraries(novus-launcher
|
target_link_libraries(novus-launcher
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Novus::Common
|
Novus::Common
|
||||||
Physis::Physis
|
Physis::Physis
|
||||||
KF6::ConfigCore
|
KF6::ConfigCore
|
||||||
Qt6::Widgets)
|
Qt6::Widgets)
|
||||||
target_include_directories(novus-launcher PUBLIC include)
|
target_include_directories(novus-launcher PUBLIC include PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
install(TARGETS novus-launcher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS novus-launcher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,14 @@
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include "launcherconfig.h"
|
||||||
|
|
||||||
static QMap<QString, QPair<QString, QString>> applications = {
|
static QMap<QString, QPair<QString, QString>> applications = {
|
||||||
{QStringLiteral("Gear Editor"), {QStringLiteral("zone.xiv.armoury"), QStringLiteral("novus-armoury")}},
|
{QStringLiteral("Gear Editor"), {QStringLiteral("zone.xiv.armoury"), GEAREDITOR_EXECUTABLE}},
|
||||||
{QStringLiteral("Map Editor"), {QStringLiteral("zone.xiv.mapeditor"), QStringLiteral("novus-mapeditor")}},
|
{QStringLiteral("Map Editor"), {QStringLiteral("zone.xiv.mapeditor"), MAPEDITOR_EXECUTABLE}},
|
||||||
{QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), QStringLiteral("novus-karuku")}},
|
{QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), EXCELEDITOR_EXECUTABLE}},
|
||||||
{QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), QStringLiteral("novus-sagasu")}},
|
{QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), DATAEXPLORER_EXECUTABLE}},
|
||||||
{QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), QStringLiteral("novus-mdlviewer")}}};
|
{QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), MDLVIEWER_EXECUTABLE}}};
|
||||||
|
|
||||||
static QMap<QString, QString> links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")},
|
static QMap<QString, QString> links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")},
|
||||||
{QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}};
|
{QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}};
|
||||||
|
|
Loading…
Add table
Reference in a new issue