File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,41 @@ if "%QMAKE%" == "" (
3939 exit /B 1
4040)
4141
42+ :: cmake options
43+ devenv /? | find " Visual Studio 2022" > NUL
44+ if not ERRORLEVEL 1 (
45+ set VSVER = 2022
46+ if /i " %Platform% " == " x64" (
47+ set CMAKEOPT = -G" Visual Studio 17 2022" -A x64
48+ ) else (
49+ set CMAKEOPT = -G" Visual Studio 17 2022" -A Win32
50+ )
51+ goto :step1
52+ )
53+
54+ devenv /? | find " Visual Studio 2019" > NUL
55+ if not ERRORLEVEL 1 (
56+ set VSVER = 2019
57+ if /i " %Platform% " == " x64" (
58+ set CMAKEOPT = -G" Visual Studio 16 2019" -A x64
59+ ) else (
60+ set CMAKEOPT = -G" Visual Studio 16 2019" -A Win32
61+ )
62+ goto :step1
63+ )
64+
65+ devenv /? | find " Visual Studio 2017" > NUL
66+ if not ERRORLEVEL 1 (
67+ set VSVER = 2017
68+ if /i " %Platform% " == " x64" (
69+ set CMAKEOPT = -G" Visual Studio 15 2017 Win64"
70+ ) else (
71+ set CMAKEOPT = -G" Visual Studio 15 2017"
72+ )
73+ goto :step1
74+ )
4275
76+ :step1
4377cd /D %BASEDIR%
4478rd /Q /S %APPNAME%
4579tspawn new %APPNAME%
@@ -97,7 +131,7 @@ cd /D %APPDIR%
97131if exist build rd /Q /S build
98132del /Q /F lib\*.*
99133cmake --version
100- cmake -S . -B build -DCMAKE_BUILD_TYPE=%1
134+ cmake %CMAKEOPT% -S . -B build -DCMAKE_BUILD_TYPE=%1
101135if ERRORLEVEL 1 (
102136 echo;
103137 echo CMake Error!
Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ static void printSuccessMessage(const QString &model)
506506 msg += " \n or\n\n cmake:\n " ;
507507 msg += " Run `cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug` to generate Makefile for debug mode.\n " ;
508508 msg += " Run `cmake -S . -B build -DCMAKE_BUILD_TYPE=Release` to generate Makefile for release mode.\n " ;
509- msg += " Run `cd build; make cmake` to regenerate Makefile." ;
509+ msg += " Run `cmake -- build build --target cmake` to regenerate Makefile." ;
510510 }
511511
512512 putchar (' \n ' );
You can’t perform that action at this time.
0 commit comments