-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
169 lines (149 loc) · 4.07 KB
/
Copy pathinstall.bat
File metadata and controls
169 lines (149 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@echo off
REM gleditor Installation Script for Windows
REM Requires MSYS2/MinGW or similar environment
setlocal enabledelayedexpansion
echo.
echo ====================================
echo gleditor Installation for Windows
echo ====================================
echo.
REM Check if running in MSYS2/MinGW environment
where bash >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo ERROR: MSYS2/MinGW environment not detected!
echo.
echo gleditor requires MSYS2 for building on Windows.
echo Please install MSYS2 from: https://www.msys2.org/
echo.
echo After installing MSYS2:
echo 1. Open MSYS2 MinGW 64-bit terminal
echo 2. Install dependencies:
echo pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
echo pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gtksourceview4
echo pacman -S mingw-w64-x86_64-pkg-config
echo 3. Navigate to gleditor directory
echo 4. Run: ./install.sh
echo.
pause
exit /b 1
)
echo Detected MSYS2/MinGW environment
echo.
REM Check for required tools
echo Checking for required tools...
where gcc >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo ERROR: gcc not found!
echo Please install mingw-w64-x86_64-gcc
exit /b 1
)
echo [OK] gcc found
where make >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo ERROR: make not found!
echo Please install mingw-w64-x86_64-make
exit /b 1
)
echo [OK] make found
where pkg-config >nul 2>&1
if %ERRORLEVEL% NEQ 0 (
echo ERROR: pkg-config not found!
echo Please install mingw-w64-x86_64-pkg-config
exit /b 1
)
echo [OK] pkg-config found
echo.
echo Checking for GTK and dependencies...
pkg-config --exists gtk+-3.0
if %ERRORLEVEL% NEQ 0 (
echo ERROR: GTK+3 not found!
echo Please install: pacman -S mingw-w64-x86_64-gtk3
exit /b 1
)
for /f "tokens=*" %%i in ('pkg-config --modversion gtk+-3.0') do set GTK_VERSION=%%i
echo [OK] GTK+3 version: %GTK_VERSION%
pkg-config --exists gtksourceview-4
if %ERRORLEVEL% NEQ 0 (
echo ERROR: GTKSourceView 4 not found!
echo Please install: pacman -S mingw-w64-x86_64-gtksourceview4
exit /b 1
)
echo [OK] GTKSourceView 4 found
echo.
echo Building gleditor...
echo.
REM Clean previous build
if exist bin\gleditor.exe del /q bin\gleditor.exe
if exist build rmdir /s /q build
REM Build using CMake if available, otherwise use Make
where cmake >nul 2>&1
if %ERRORLEVEL% EQU 0 (
echo Using CMake build system...
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
cd ..
if exist build\gleditor.exe (
echo.
echo [SUCCESS] Build completed!
echo.
REM Copy executable to bin directory
if not exist bin mkdir bin
copy /y build\gleditor.exe bin\gleditor.exe
REM Copy required DLLs
echo Copying required DLLs...
for %%f in (
libgcc_s_seh-1.dll
libstdc++-6.dll
libwinpthread-1.dll
libgtk-3-0.dll
libgdk-3-0.dll
libglib-2.0-0.dll
libgobject-2.0-0.dll
libgio-2.0-0.dll
libcairo-2.0.dll
libpango-1.0-0.dll
libgtksourceview-4-0.dll
) do (
where %%f >nul 2>&1
if !ERRORLEVEL! EQU 0 (
for /f "tokens=*" %%p in ('where %%f') do (
copy /y "%%p" bin\ >nul 2>&1
)
)
)
) else (
echo [ERROR] Build failed!
exit /b 1
)
) else (
echo CMake not found, using Makefile...
make clean
make
if exist bin\gleditor.exe (
echo.
echo [SUCCESS] Build completed!
echo.
) else (
echo [ERROR] Build failed!
exit /b 1
)
)
echo.
echo ====================================
echo Installation Complete!
echo ====================================
echo.
echo To run gleditor:
echo cd bin
echo gleditor.exe
echo.
echo Or add the bin directory to your PATH.
echo.
echo Configuration files will be saved to:
echo %%APPDATA%%\gleditor
echo.
echo Happy shader coding! ^_^
echo.
pause