mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
Compare commits
4 Commits
cc69874ebc
...
27cd6a339d
| Author | SHA1 | Date | |
|---|---|---|---|
| 27cd6a339d | |||
| ef4de7fa43 | |||
| fee594b56e | |||
| f3ba0d810a |
@@ -1,6 +1,8 @@
|
|||||||
cmake_minimum_required(VERSION 3.10)
|
cmake_minimum_required(VERSION 3.10)
|
||||||
project(launcher)
|
project(launcher)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||||
|
|
||||||
@@ -28,6 +30,8 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||||||
add_link_options(-O3)
|
add_link_options(-O3)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
include(wxWidgets)
|
||||||
|
|
||||||
add_subdirectory(utils)
|
add_subdirectory(utils)
|
||||||
add_subdirectory(backend)
|
add_subdirectory(backend)
|
||||||
add_subdirectory(gui)
|
add_subdirectory(gui)
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
find_package(wxWidgets REQUIRED COMPONENTS base)
|
|
||||||
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
|
|
||||||
include(${wxWidgets_USE_FILE})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_library(backend
|
add_library(backend
|
||||||
src/DhfsInstance.cpp
|
src/DhfsInstance.cpp
|
||||||
include_public/DhfsInstance.hpp
|
include_public/DhfsInstance.hpp
|
||||||
|
|||||||
26
launcher/cmake/wxWidgets.cmake
Normal file
26
launcher/cmake/wxWidgets.cmake
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# if linux
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
option(wxWidgets_IN_TREE_BUILD "Build wxWidgets in-tree" OFF)
|
||||||
|
else ()
|
||||||
|
option(wxWidgets_IN_TREE_BUILD "Build wxWidgets in-tree" ON)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (wxWidgets_IN_TREE_BUILD)
|
||||||
|
message(STATUS "Building wxWidgets in-tree")
|
||||||
|
include(FetchContent)
|
||||||
|
set(wxBUILD_SHARED OFF)
|
||||||
|
FetchContent_Declare(wx
|
||||||
|
GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
|
||||||
|
GIT_TAG v3.2.8.1
|
||||||
|
GIT_SHALLOW TRUE
|
||||||
|
GIT_PROGRESS TRUE
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(wx)
|
||||||
|
set(wxWidgets_LIBRARIES wx::core wx::base wx::webview wx::net)
|
||||||
|
else ()
|
||||||
|
message(STATUS "Using system wxWidgets")
|
||||||
|
find_package(wxWidgets REQUIRED COMPONENTS net core base webview)
|
||||||
|
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
|
||||||
|
include(${wxWidgets_USE_FILE})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
@@ -1,9 +1,3 @@
|
|||||||
|
|
||||||
find_package(wxWidgets REQUIRED COMPONENTS net core base webview)
|
|
||||||
if (wxWidgets_USE_FILE) # not defined in CONFIG mode
|
|
||||||
include(${wxWidgets_USE_FILE})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
add_executable(launcher
|
add_executable(launcher
|
||||||
src/LauncherApp.cpp
|
src/LauncherApp.cpp
|
||||||
src/GLauncherApp.cpp
|
src/GLauncherApp.cpp
|
||||||
@@ -13,4 +7,10 @@ add_executable(launcher
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(launcher ${wxWidgets_LIBRARIES})
|
target_link_libraries(launcher ${wxWidgets_LIBRARIES})
|
||||||
target_link_libraries(launcher backend utils)
|
target_link_libraries(launcher backend utils)
|
||||||
|
|
||||||
|
set_target_properties(launcher PROPERTIES
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER "com.usatiuk.dhfs.launcher"
|
||||||
|
MACOSX_BUNDLE_BUNDLE_NAME "DHFS Launcher"
|
||||||
|
)
|
||||||
@@ -2,12 +2,24 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <wx/fileconf.h>
|
#include <wx/fileconf.h>
|
||||||
|
#include <wx/stdpaths.h>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
|
||||||
wxDEFINE_EVENT(NEW_LINE_OUTPUT_EVENT, wxCommandEvent);
|
wxDEFINE_EVENT(NEW_LINE_OUTPUT_EVENT, wxCommandEvent);
|
||||||
wxDEFINE_EVENT(DHFS_STATE_CHANGE_EVENT, wxCommandEvent);
|
wxDEFINE_EVENT(DHFS_STATE_CHANGE_EVENT, wxCommandEvent);
|
||||||
|
|
||||||
|
std::string getBundlePath() {
|
||||||
|
if (wxGetenv("DHFS_BUNDLE_PATH") == NULL)
|
||||||
|
return std::filesystem::path(wxStandardPaths::Get().GetExecutablePath().ToStdString())
|
||||||
|
#ifndef __APPLE__
|
||||||
|
.parent_path()
|
||||||
|
#endif
|
||||||
|
.parent_path().string();
|
||||||
|
return wxGetenv("DHFS_BUNDLE_PATH");
|
||||||
|
}
|
||||||
|
|
||||||
LauncherAppMainFrame::LauncherAppMainFrame(wxWindow* parent)
|
LauncherAppMainFrame::LauncherAppMainFrame(wxWindow* parent)
|
||||||
: MainFrame(parent) {
|
: MainFrame(parent) {
|
||||||
m_javaHomeDirPicker->SetPath(wxFileConfig::Get()->Read(kJavaHomeSettingsKey));
|
m_javaHomeDirPicker->SetPath(wxFileConfig::Get()->Read(kJavaHomeSettingsKey));
|
||||||
@@ -79,9 +91,8 @@ void LauncherAppMainFrame::OnStartStopButtonClick(wxCommandEvent& event) {
|
|||||||
options.xmx = "512m";
|
options.xmx = "512m";
|
||||||
options.mount_path = wxFileConfig::Get()->Read(kMountPointSettingsKey);
|
options.mount_path = wxFileConfig::Get()->Read(kMountPointSettingsKey);
|
||||||
options.data_path = wxFileConfig::Get()->Read(kDataDirSettingsKey);
|
options.data_path = wxFileConfig::Get()->Read(kDataDirSettingsKey);
|
||||||
std::string bundlePath = wxGetenv("DHFS_BUNDLE_PATH");
|
options.jar_path = getBundlePath() + "/app/Server/quarkus-run.jar";
|
||||||
options.jar_path = bundlePath + "/app/Server/quarkus-run.jar";
|
options.webui_path = getBundlePath() + "/app/Webui";
|
||||||
options.webui_path = bundlePath + "/app/Webui";
|
|
||||||
|
|
||||||
_dhfsInstance.start(options);
|
_dhfsInstance.start(options);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user