alice
(alice)
1
I write a batch file to install lib.
If I run it install.bat
on command prompt. It can generate the release folder.
But I try to double click the install.bat. It will not generate the release folder.
Here is this install.bat batch file
cmake -G "Visual Studio 16 2019" ^
-S ./ ^
-B ./build-release ^
-DCMAKE_BUILD_TYPE=release ^
cmake --build build-release --config release
cmake --install build-release --config release --prefix ../release
ben.boeckel
(Ben Boeckel (Kitware))
2
Double clicking doesn’t really have a current working directory defined AFAIK. I recommend adding a cd
to the right directory in there.
alice
(alice)
3
Sorry, I don’t know how to use cd on this sample.
Because I use --prefix to assign the install path.
jtxa
(Josef Angstenberger)
4
Use this at the beginning of your batch:
PUSHD %~dp0
JRR
(John Rocha)
5
Also consider adding a
pause
call at the end of the script so that the windows stays open so you can see any errors that may occur (or revel in your success!)