mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-27 22:27:46 +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-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)
|
||||
target_sources(novus-launcher
|
||||
PRIVATE
|
||||
include/mainwindow.h
|
||||
|
||||
src/main.cpp
|
||||
src/mainwindow.cpp)
|
||||
src/mainwindow.cpp
|
||||
|
||||
launcherconfig.h)
|
||||
target_link_libraries(novus-launcher
|
||||
PRIVATE
|
||||
Novus::Common
|
||||
Physis::Physis
|
||||
KF6::ConfigCore
|
||||
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})
|
||||
|
||||
|
@ -43,4 +70,4 @@ qt_generate_deploy_app_script(
|
|||
OUTPUT_SCRIPT deploy_script
|
||||
NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
)
|
||||
install(SCRIPT ${deploy_script})
|
||||
install(SCRIPT ${deploy_script})
|
|
@ -15,12 +15,14 @@
|
|||
#include <QUrl>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "launcherconfig.h"
|
||||
|
||||
static QMap<QString, QPair<QString, QString>> applications = {
|
||||
{QStringLiteral("Gear Editor"), {QStringLiteral("zone.xiv.armoury"), QStringLiteral("novus-armoury")}},
|
||||
{QStringLiteral("Map Editor"), {QStringLiteral("zone.xiv.mapeditor"), QStringLiteral("novus-mapeditor")}},
|
||||
{QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), QStringLiteral("novus-karuku")}},
|
||||
{QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), QStringLiteral("novus-sagasu")}},
|
||||
{QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), QStringLiteral("novus-mdlviewer")}}};
|
||||
{QStringLiteral("Gear Editor"), {QStringLiteral("zone.xiv.armoury"), GEAREDITOR_EXECUTABLE}},
|
||||
{QStringLiteral("Map Editor"), {QStringLiteral("zone.xiv.mapeditor"), MAPEDITOR_EXECUTABLE}},
|
||||
{QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), EXCELEDITOR_EXECUTABLE}},
|
||||
{QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), DATAEXPLORER_EXECUTABLE}},
|
||||
{QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), MDLVIEWER_EXECUTABLE}}};
|
||||
|
||||
static QMap<QString, QString> links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")},
|
||||
{QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}};
|
||||
|
|
Loading…
Add table
Reference in a new issue