How do I run a .bat file from CMake in a pre-link or a post-build event?
Asked
Active
Viewed 1.3k times
2 Answers
5
The following also works. In case you read or create a file inside the bat script don't forget to specify the exact path inside the bat script.
ADD_CUSTOM_TARGET(
myCustomTarget
COMMAND cmd /c E:/Myfiles/mytxt.bat
)
ADD_DEPENDENCIES(myTarget myCustomTarget)
myTarget will be executed after myCustomTarget.
Peter Mortensen
- 30,030
- 21
- 100
- 124
Vsegar
- 103
- 1
- 8