How to Set Path Environment Variable using CMake and Visual Studio to Run Test

后端 未结 6 1646
梦毁少年i
梦毁少年i 2020-12-02 06:27

I am using CMake to generate Visual Studio project files. I want to run the test executable after setting the PATH environment variable so that it is able to load the requir

6条回答
  •  借酒劲吻你
    2020-12-02 07:22

    Just wanted to point out that a very useful addition that allows you to set up multiple environment variables as opposed to only one (e.g., only PATH) is given in this link https://stackoverflow.com/a/40531167/9253113

    For example, if in addition to setting PATH you wanted to set another variable OTHERVAR one would have to modify the line

    PATH=C:\Test
    

    to

    PATH=C:\Test 
    OTHERVAR="value of OTHERVAR"
    

    Where the symbol " " tells the xml parser to introduce the LF character. So multiple variable definitions are possible if separated by the LF character (also the CR character works but NOT the combination CRLF)

    Also notice that there CANNOT be any space between and the next variable.

提交回复
热议问题