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

后端 未结 6 1654
梦毁少年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:04

    Just spotted this question now. To debug cmake files I use

    MESSAGE( STATUS "static text ${variable}" )
    

    I have never had to set the path get my tests to run. Are you using CTest? It looks like the link you are following is used with ctest.

    If I was trying to get this to work I would use set_tests_properties explicitly first.

    set_tests_properties(SomeTest PROPERTIES ENVIRONMENT "PATH=c:\somedir;c:\otherdir")
    

    Then make it more general.

提交回复
热议问题