diff --git a/.github/workflows/build.yml b/.github/workflows/build-linux.yml
similarity index 92%
rename from .github/workflows/build.yml
rename to .github/workflows/build-linux.yml
index f324db4d3..b98bd033d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build-linux.yml
@@ -1,4 +1,4 @@
-name: Build RME
+name: Build - Linux
on:
push:
@@ -33,8 +33,11 @@ jobs:
freeglut3-dev \
libarchive-dev \
zlib1g-dev \
+ libarchive-dev \
+ zlib1g-dev \
libxmu-dev \
- libxi-dev
+ libxi-dev \
+ liblua5.3-dev
- name: Setup ccache
run: |
diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml
new file mode 100644
index 000000000..f40add636
--- /dev/null
+++ b/.github/workflows/build-windows.yml
@@ -0,0 +1,89 @@
+name: Build - Windows
+
+on:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+jobs:
+ build-windows:
+ name: Windows-Release
+ runs-on: windows-2022
+
+ env:
+ CMAKE_BUILD_PARALLEL_LEVEL: 4
+ VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}\vcpkg_cache
+ VCPKG_COMMIT: '734f8130ffe2f02cf855a3a42a2958f01b3fb005'
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ fetch-depth: 0
+
+ - name: Get latest CMake and Ninja
+ uses: lukka/get-cmake@v3.31.6
+
+ - name: Create vcpkg cache directory
+ run: mkdir -p "${{ env.VCPKG_DEFAULT_BINARY_CACHE }}"
+ shell: bash
+
+ - name: Restore vcpkg binary cache
+ id: vcpkg-cache
+ uses: actions/cache@v4
+ with:
+ path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
+ key: vcpkg-bin-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('vcpkg.json') }}
+ restore-keys: |
+ vcpkg-bin-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
+
+ - name: Restore vcpkg installed packages
+ id: vcpkg-installed
+ uses: actions/cache@v4
+ with:
+ path: build/vcpkg_installed
+ key: vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('vcpkg.json') }}
+ restore-keys: |
+ vcpkg-installed-${{ runner.os }}-${{ env.VCPKG_COMMIT }}-
+
+ - name: Setup vcpkg
+ uses: lukka/run-vcpkg@v11
+ with:
+ vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
+ vcpkgJsonGlob: 'vcpkg.json'
+
+ - name: Configure CMake
+ shell: pwsh
+ run: |
+ cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
+ -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
+ -DVCPKG_TARGET_TRIPLET=x64-windows-static `
+ -DVCPKG_INSTALL_OPTIONS="--clean-after-build" `
+ -DCMAKE_BUILD_TYPE=Release
+
+ - name: Build
+ shell: pwsh
+ run: cmake --build build --config Release --parallel
+
+ - name: Prepare Artifacts
+ shell: pwsh
+ run: |
+ $artifactDir = "$env:GITHUB_WORKSPACE\artifacts"
+ New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null
+
+ $exePath = Get-ChildItem -Recurse -Path "$env:GITHUB_WORKSPACE\build" -Filter "rme.exe" | Select-Object -First 1
+
+ if (-not $exePath) {
+ Write-Error "Not found rme.exe!"
+ exit 1
+ }
+
+ Copy-Item $exePath.FullName -Destination $artifactDir
+
+ - name: Upload Artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: rme-windows
+ path: artifacts/
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000..f4dc852f7
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,148 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+ - 'Hotfix*'
+ - 'Release*'
+ - 'Hotfix *'
+ - 'Release *'
+
+permissions:
+ contents: write
+
+jobs:
+ release:
+ name: Release ${{ matrix.os }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-24.04
+ asset_prefix: rme-linux
+ - os: windows-2022
+ asset_prefix: rme-windows
+
+ env:
+ CMAKE_BUILD_PARALLEL_LEVEL: 2
+ LUKKA_RUN_VCPKG_SHA: '734f8130ffe2f02cf855a3a42a2958f01b3fb005'
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ fetch-depth: 0
+
+ # --- Linux Dependencies ---
+ - name: Install Dependencies (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y \
+ build-essential cmake ccache libasio-dev nlohmann-json3-dev \
+ libfmt-dev libboost-system-dev libboost-thread-dev libwxgtk3.2-dev \
+ libglu1-mesa-dev freeglut3-dev libarchive-dev zlib1g-dev \
+ libxmu-dev libxi-dev liblua5.3-dev
+
+ # --- Windows Dependencies ---
+ - name: Get latest CMake (Windows)
+ if: runner.os == 'Windows'
+ uses: lukka/get-cmake@v3.31.6
+
+ - name: Setup vcpkg (Windows)
+ if: runner.os == 'Windows'
+ uses: lukka/run-vcpkg@v11
+ with:
+ vcpkgGitCommitId: ${{ env.LUKKA_RUN_VCPKG_SHA }}
+
+ - name: Install Dependencies via vcpkg (Windows)
+ if: runner.os == 'Windows'
+ shell: pwsh
+ run: |
+ $deps = @("wxwidgets", "boost-thread", "boost-system", "libarchive", "freeglut", "zlib", "lua", "cpr", "nlohmann-json")
+ & "$env:VCPKG_ROOT/vcpkg" install $deps --triplet x64-windows-static
+
+ # --- Configure ---
+ - name: Configure CMake (Linux)
+ if: runner.os == 'Linux'
+ run: |
+ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
+
+ - name: Configure CMake (Windows)
+ if: runner.os == 'Windows'
+ shell: pwsh
+ run: |
+ cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
+ -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
+ -DVCPKG_TARGET_TRIPLET=x64-windows-static `
+ -DCMAKE_BUILD_TYPE=Release
+
+ # --- Build ---
+ - name: Build
+ run: cmake --build build --config Release --parallel 2
+
+ # --- Package ---
+ - name: Prepare Release Bundle
+ shell: bash
+ run: |
+ mkdir release_package
+
+ # Copy Executable
+ if [ "${{ runner.os }}" == "Windows" ]; then
+ find build -name "rme.exe" -exec cp {} release_package/ \;
+ else
+ find build -name "rme" -exec cp {} release_package/ \;
+ chmod +x release_package/rme
+ fi
+
+ # Copy Resources
+ cp -r data release_package/
+ [ -d "brushes" ] && cp -r brushes release_package/
+ [ -d "icons" ] && cp -r icons release_package/
+ [ -d "extensions" ] && cp -r extensions release_package/
+ [ -d "modules" ] && cp -r modules release_package/
+ [ -d "scripts" ] && cp -r scripts release_package/
+
+ # Copy License/Readme
+ [ -f "LICENSE" ] && cp LICENSE release_package/
+ [ -f "LICENSE.rtf" ] && cp LICENSE.rtf release_package/
+ [ -f "README.md" ] && cp README.md release_package/
+
+ - name: Prepare Source Bundle
+ if: runner.os == 'Windows'
+ shell: bash
+ run: |
+ mkdir source_package
+ [ -d "source" ] && cp -r source source_package/
+ [ -d "vcproj" ] && cp -r vcproj source_package/
+ [ -f "CMakeLists.txt" ] && cp CMakeLists.txt source_package/
+ [ -f "vcpkg.json" ] && cp vcpkg.json source_package/
+ [ -f "LICENSE.rtf" ] && cp LICENSE.rtf source_package/
+ [ -f "README.md" ] && cp README.md source_package/
+
+ - name: Zip Source
+ if: runner.os == 'Windows'
+ uses: thedoctor0/zip-release@0.7.6
+ with:
+ type: zip
+ filename: rme-source-${{ github.ref_name }}.zip
+ path: source_package/
+
+ - name: Zip Release
+ uses: thedoctor0/zip-release@0.7.6
+ with:
+ type: zip
+ filename: ${{ matrix.asset_prefix }}-${{ github.ref_name }}.zip
+ path: release_package/
+
+ # --- Upload ---
+ - name: Upload Release Artifact
+ uses: ncipollo/release-action@v1
+ with:
+ artifacts: "*.zip"
+ allowUpdates: true
+ replacesArtifacts: true
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2f8d6b11..415828eb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,16 +1,32 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.12)
project(rme)
+if(POLICY CMP0072)
+ cmake_policy(SET CMP0072 NEW) # Prefer GLVND
+endif()
+
+if(POLICY CMP0167)
+ cmake_policy(SET CMP0167 NEW) # Use BoostConfig
+endif()
+
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
-set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations -Wno-overloaded-virtual -Wno-strict-aliasing -Wno-sign-compare -Wno-unused-function -Wunused-result")
-set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -D__DEBUG__")
-set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "/W3 /EHsc /D_CRT_SECURE_NO_WARNINGS")
+ set(CMAKE_CXX_FLAGS_DEBUG "/Od /Zi /D__DEBUG__")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "/O1 /DNDEBUG")
+ set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Zi")
+else()
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations -Wno-overloaded-virtual -Wno-strict-aliasing -Wno-sign-compare -Wno-unused-function -Wunused-result")
+ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -D__DEBUG__")
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+endif()
find_package(OpenGL REQUIRED)
@@ -29,6 +45,88 @@ find_package(wxWidgets COMPONENTS html aui gl adv core net base REQUIRED)
find_package(GLUT REQUIRED)
find_package(ZLIB REQUIRED)
+# Lua scripting support
+if(MSVC)
+ # Windows/vcpkg specific configuration
+ find_package(lua CONFIG REQUIRED)
+ find_package(sol2 CONFIG REQUIRED)
+ find_package(cpr CONFIG REQUIRED)
+ find_package(nlohmann_json CONFIG REQUIRED)
+
+ # Validate Lua target from vcpkg
+ if(TARGET lua::lua)
+ set(LUA_LIB_TARGET lua::lua)
+ elseif(TARGET lua)
+ set(LUA_LIB_TARGET lua)
+ else()
+ message(FATAL_ERROR "Lua target not found in vcpkg config!")
+ endif()
+
+ # Explicitly add Lua includes to global path to ensure sol2 finds 'lua.hpp'
+ get_target_property(VCPKG_LUA_INCLUDES ${LUA_LIB_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
+ if(VCPKG_LUA_INCLUDES)
+ include_directories(${VCPKG_LUA_INCLUDES})
+ endif()
+
+ add_compile_definitions(SOL_USING_CXX_LUA_HPP=1)
+
+ set(LIBS_TO_LINK ${LUA_LIB_TARGET} cpr::cpr nlohmann_json::nlohmann_json sol2::sol2)
+
+else()
+ # Linux / Standard CMake Module configuration
+ find_package(Lua REQUIRED)
+
+ include(FetchContent)
+
+ # sol2
+ find_package(sol2 CONFIG QUIET)
+ if(NOT sol2_FOUND)
+ message(STATUS "sol2 not found via find_package, using FetchContent...")
+ FetchContent_Declare(
+ sol2
+ GIT_REPOSITORY https://github.com/ThePhD/sol2.git
+ GIT_TAG v3.3.0
+ )
+ FetchContent_MakeAvailable(sol2)
+ if(NOT TARGET sol2::sol2)
+ if(TARGET sol2)
+ add_library(sol2::sol2 ALIAS sol2)
+ else()
+ set(SOL2_INCLUDE_DIRS ${sol2_SOURCE_DIR}/include)
+ include_directories(${SOL2_INCLUDE_DIRS})
+ add_library(sol2::sol2 INTERFACE IMPORTED)
+ set_target_properties(sol2::sol2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOL2_INCLUDE_DIRS}")
+ endif()
+ endif()
+ endif()
+
+ # cpr
+ find_package(cpr CONFIG QUIET)
+ if(NOT cpr_FOUND)
+ message(STATUS "cpr not found via find_package, using FetchContent...")
+ FetchContent_Declare(
+ cpr
+ GIT_REPOSITORY https://github.com/libcpr/cpr.git
+ GIT_TAG 1.10.5
+ )
+ FetchContent_MakeAvailable(cpr)
+ endif()
+
+ # nlohmann_json
+ find_package(nlohmann_json CONFIG QUIET)
+ if(NOT nlohmann_json_FOUND)
+ message(STATUS "nlohmann_json not found via find_package, using FetchContent...")
+ FetchContent_Declare(
+ json
+ GIT_REPOSITORY https://github.com/nlohmann/json.git
+ GIT_TAG v3.11.3
+ )
+ FetchContent_MakeAvailable(json)
+ endif()
+
+ set(LIBS_TO_LINK ${LUA_LIBRARIES} cpr::cpr nlohmann_json::nlohmann_json sol2::sol2)
+endif()
+
include(${wxWidgets_USE_FILE})
include(source/CMakeLists.txt)
add_executable(rme ${rme_H} ${rme_SRC})
@@ -36,5 +134,5 @@ add_executable(rme ${rme_H} ${rme_SRC})
set_target_properties(rme PROPERTIES CXX_STANDARD 17)
set_target_properties(rme PROPERTIES CXX_STANDARD_REQUIRED ON)
-include_directories(${Boost_INCLUDE_DIRS} ${LibArchive_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
-target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES})
\ No newline at end of file
+include_directories(${CMAKE_SOURCE_DIR}/source ${Boost_INCLUDE_DIRS} ${LibArchive_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUA_INCLUDE_DIRS})
+target_link_libraries(rme ${wxWidgets_LIBRARIES} ${Boost_LIBRARIES} ${LibArchive_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBS_TO_LINK})
diff --git a/data/menubar.xml b/data/menubar.xml
index f49671231..618045940 100644
--- a/data/menubar.xml
+++ b/data/menubar.xml
@@ -235,6 +235,14 @@
+