1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 13:17:46 +00:00

Create separate executable for exdviewer

This commit is contained in:
Joshua Goins 2022-04-11 21:54:30 -04:00
parent aa96d8906a
commit cafd3e5dca
5 changed files with 29 additions and 24 deletions

View file

@ -30,27 +30,4 @@ else()
set(LIBRARIES fmt::fmt ${LIBRARIES})
endif()
add_executable(novus
src/main.cpp
src/mainwindow.cpp)
target_include_directories(novus
PUBLIC
include)
target_link_libraries(novus PUBLIC libxiv ${LIBRARIES} Qt5::Core Qt5::Widgets)
install(TARGETS novus
DESTINATION "${INSTALL_BIN_PATH}")
if(WIN32)
get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY)
find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}")
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
# Run windeployqt immediately after build
add_custom_command(TARGET novus
POST_BUILD
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:novus>\"
)
endif()
add_subdirectory(exdviewer)

24
exdviewer/CMakeLists.txt Normal file
View file

@ -0,0 +1,24 @@
add_executable(exdviewer
src/main.cpp
src/mainwindow.cpp)
target_include_directories(exdviewer
PUBLIC
include)
target_link_libraries(exdviewer PUBLIC libxiv ${LIBRARIES} Qt5::Core Qt5::Widgets)
install(TARGETS exdviewer
DESTINATION "${INSTALL_BIN_PATH}")
if(WIN32)
get_target_property(QMAKE_EXE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QMAKE_EXE}" DIRECTORY)
find_program(WINDEPLOYQT_ENV_SETUP qtenv2.bat HINTS "${QT_BIN_DIR}")
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
# Run windeployqt immediately after build
add_custom_command(TARGET exdviewer
POST_BUILD
COMMAND "${WINDEPLOYQT_ENV_SETUP}" && "${WINDEPLOYQT_EXECUTABLE}" \"$<TARGET_FILE:exdviewer>\"
)
endif()

View file

@ -8,6 +8,7 @@
#include "gamedata.h"
#include "exhparser.h"
#include "exdparser.h"
#include "mdlparser.h"
MainWindow::MainWindow(GameData& data) : data(data) {
setWindowTitle("Novus");
@ -25,6 +26,9 @@ MainWindow::MainWindow(GameData& data) : data(data) {
auto* pageTabWidget = new QTabWidget();
data.extractFile("chara/equipment/e0000/model/c0201e0000_top.mdl", "top.mdl");
parseMDL("top.mdl");
connect(listWidget, &QListWidget::itemClicked, this, [&data, pageTabWidget](QListWidgetItem* item) {
pageTabWidget->clear();