/
funcvsproj.bat
executable file
·144 lines (122 loc) · 2.54 KB
/
funcvsproj.bat
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
@echo off
mkdir %~dp0vsproj
cd %~dp0vsproj
REM if not exist param.bat (
REM echo Rename param.bat.sample to param.bat and edit it.
REM goto :end
REM )
REM call param.bat
if not exist %~dp0prepare.bat (
echo prepare.bat not exist. Copy prepare.bat.sample and edit it.
goto :end
)
call %~dp0prepare.bat
if [%DEL%] == [] (
echo DEL not defined.
goto :end
)
if [%QTROOT%] == [] (
echo QTROOT not defined.
goto :end
)
if [%VCVARSBAT%] == [] (
echo VCVARSBAT not defined.
goto end:
)
if [%DEVENV%] == [] (
echo DEVENV not defined.
goto :end
)
if [%VSQTVER%] == [] (
echo VSQTVER not defined.
goto :end
)
if [%PRONAME%] == [] (
echo PRONAME not defined.
goto :end
)
if [%VSQTTOOL%] == [] (
echo VSQTTOOL not defined.
goto :end
)
if [%PRONAME%] == [] (
echo PRONAME not defined.
goto :end
)
if [%SOURCEDIR%] == [] (
echo SOURCEDIR not defined.
goto :end
)
if not exist ..\%SOURCEDIR%\ (
echo ..\%SOURCEDIR%\ not found or not a directory
goto :end
)
set QTBIN=%QTROOT%\%VSQTVER%\%VSQTTOOL%\bin
if not exist %QTBIN%\ (
echo %QTBINT% not found or not a directory
goto :end
)
set PATH=%QTBIN%;%PATH%
set SOLUTION=%PRONAME%.sln
set VCXPROJ=%PRONAME%.vcxproj
set VCXFILTERS=%PRONAME%.vcxproj.filters
set PRO=..\%SOURCEDIR%\%PRONAME%.pro
if not exist %PRO% (
echo %PRO% not found.
goto :end
)
if exist %SOLUTION% (
echo "%SOLUTION% already exists, start launching it...
goto :launchsln
)
if exist %SOLUTION% (
%DEL% %SOLUTION%
)
if exist %SOLUTION% (
echo Failed to delete %SOLUTION%.
goto :end
)
if exist %VCXPROJ% (
%DEL% %VCXPROJ%
)
if exist %VCXPROJ% (
echo Failed to delete %VCXPROJ%.
goto :end
)
if exist %VCXFILTERS% (
%DEL% %VCXFILTERS%
)
if exist %VCXFILTERS% (
echo Failed to delete %VCXFILTERS%.
goto :end
)
REM set OPENDBFILE=.vs\%PRONAME%\v15\Browse.VC.opendb
REM if exist %OPENDBFILE% (
REM DEL %OPENDBFILE%
REM if exist %OPENDBFILE% (
REM echo %OPENDBFILE% exists. Close VS first.
REM goto :end
REM )
REM )
if not exist %VCVARSBAT% (
echo %VCVARSBAT% not found.
goto :end
)
set QMAKE=%QTBIN%\qmake.exe
if not exist %QMAKE% (
echo %QMAKE% not found.
goto :end
)
call %VCVARSBAT% %VCVARSBATARG%
cd %~dp0vsproj
call %QMAKE% -tp vc %PRO%
cd %~dp0vsproj
echo "==== Creating Visual Studio project successful ===="
echo launching %DEVENV% %VCXPROJ%
start "" %DEVENV% %VCXPROJ%
exit /b
:launchsln
start "" %DEVENV% %SOLUTION%
exit /b
:end
pause