Skip to content
Snippets Groups Projects
  • AlQuemist's avatar
    9bcbc483
    Correct ctest commands which need setting environmental variables · 9bcbc483
    AlQuemist authored
    The correct platform-independent CMake command to set environmental variables is
    ```
    add_test(NAME <test-name> COMMAND ${CMAKE_COMMAND} -E env ...)
    ```
    
    Otherwise, CMake assumes the existence of an executable like `env` (or `env.exe`
    under Windows). Under Windows, this will lead to an error when such tests are
    executed via `ctest`.
    9bcbc483
    History
    Correct ctest commands which need setting environmental variables
    AlQuemist authored
    The correct platform-independent CMake command to set environmental variables is
    ```
    add_test(NAME <test-name> COMMAND ${CMAKE_COMMAND} -E env ...)
    ```
    
    Otherwise, CMake assumes the existence of an executable like `env` (or `env.exe`
    under Windows). Under Windows, this will lead to an error when such tests are
    executed via `ctest`.