broken
This commit is contained in:
@@ -4,3 +4,5 @@
|
||||
/cmake-build-release-visual-studio/
|
||||
/cmake-build-minsizerel-visual-studio/
|
||||
/installer/.idea/
|
||||
/installer/build/
|
||||
/installer/dist/
|
||||
|
||||
@@ -16,3 +16,9 @@
|
||||
[submodule "lib/cppcodec"]
|
||||
path = lib/cppcodec
|
||||
url = https://github.com/tplgy/cppcodec.git
|
||||
[submodule "lib/fltk"]
|
||||
path = lib/fltk
|
||||
url = https://github.com/fltk/fltk.git
|
||||
[submodule "lib/moonfltk"]
|
||||
path = lib/moonfltk
|
||||
url = https://git.schmidti.digital/Yadciel/moonfltk.git
|
||||
|
||||
+6
-1
@@ -7,14 +7,19 @@ set(BUILD_SHARED_LIBS OFF)
|
||||
option(BUILD_SHARED_LIBS "Build as shared library" ON)
|
||||
|
||||
add_subdirectory(lib/c_tray)
|
||||
add_subdirectory(lib/fltk)
|
||||
add_subdirectory(lib/json)
|
||||
add_subdirectory(lib/cppcodec)
|
||||
add_subdirectory(lib/saucer)
|
||||
add_subdirectory(lib/lua)
|
||||
add_subdirectory(lib/sol2)
|
||||
add_subdirectory(lib/moonfltk)
|
||||
|
||||
include_directories(inc)
|
||||
include_directories(lib/json/include/nlohmann)
|
||||
|
||||
#include_directories(lib/fltk/fl)
|
||||
|
||||
#include_directories(out_embed)
|
||||
|
||||
if(WIN32)
|
||||
@@ -44,7 +49,7 @@ file(GLOB_RECURSE SOURCES "src/*.cpp" "inc/*.h")
|
||||
add_executable(Toolbox main.cpp ${SOURCES} ${RESOURCE_FILES} ${PLATFORM_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE "out_embed")
|
||||
target_link_libraries(Toolbox PRIVATE saucer::saucer sol2::sol2 lua tray nlohmann_json cppcodec)
|
||||
target_link_libraries(Toolbox PRIVATE saucer::saucer sol2::sol2 tray nlohmann_json cppcodec fltk::fltk moonfltk lua)
|
||||
|
||||
if(WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel"))
|
||||
set_target_properties(Toolbox PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
[],
|
||||
name='toolbox_installer',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
uac_admin=True,
|
||||
icon=['..\\res\\ico\\toolbox.ico'],
|
||||
)
|
||||
Submodule
+1
Submodule lib/fltk added at 34b5fe9e92
Submodule
+1
Submodule lib/moonfltk added at 8c63723dbb
+14
-7
@@ -241,12 +241,22 @@ void ToolboxWindow::fillToolboxMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
void ToolboxWindow::run_lua(int id) {
|
||||
extern "C" int luaopen_moonfltk(lua_State* L);
|
||||
|
||||
// Lambda-Funktion, um das Lua-Skript auszuführen
|
||||
void ToolboxWindow::run_lua(int id) {
|
||||
auto lua_task = [this, id]() {
|
||||
sol::state lua;
|
||||
lua.open_libraries(sol::lib::base, sol::lib::os);
|
||||
lua.open_libraries(sol::lib::base, sol::lib::os, sol::lib::utf8, sol::lib::package);
|
||||
|
||||
// Hier machen wir das statisch eingebundene Modul 'moonfltk' für require verfügbar:
|
||||
lua["package"]["preload"]["moonfltk"] = luaopen_moonfltk;
|
||||
|
||||
|
||||
// Teste, ob require nun verfügbar ist:
|
||||
sol::object req = lua["require"];
|
||||
if (!req.is<sol::function>()) {
|
||||
std::cerr << "require is not available!" << std::endl;
|
||||
}
|
||||
|
||||
try {
|
||||
std::string scriptPath = m_toolboxItems[id].lua_script;
|
||||
@@ -258,11 +268,8 @@ void ToolboxWindow::run_lua(int id) {
|
||||
}
|
||||
};
|
||||
|
||||
// Erstellen und starten des Threads
|
||||
std::thread lua_thread(lua_task);
|
||||
|
||||
// Optional: Warten auf den Abschluss des Threads
|
||||
lua_thread.detach(); // Falls Sie den Thread nicht blockieren wollen
|
||||
lua_thread.detach();
|
||||
|
||||
std::cout << "Lua-Skript wurde gestartet." << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user