How do I run a .bat file from CMake?

后端 未结 2 1000
滥情空心
滥情空心 2021-02-09 02:52

How do I run a .bat file from CMake in a pre-link or a post-build event?

2条回答
  •  没有蜡笔的小新
    2021-02-09 03:21

    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.

提交回复
热议问题