# Using the ENVIRONMENT\_MODIFICATION property

**URL:** <https://discourse.cmake.org/t/using-the-environment-modification-property/4479>\
**Category:** Code\
**Created:** [November 14, 2021, 4:13pm UTC](https://discourse.cmake.org/t/using-the-environment-modification-property/4479 "2021-11-14T16:13:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moongoal](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@moongoal](https://discourse.cmake.org/u/moongoal)\
**Post date:** [November 14, 2021, 4:13pm UTC](https://discourse.cmake.org/t/using-the-environment-modification-property/4479/1 "2021-11-14T16:13:24Z")

</div>

Hi,

I’m attempting creation of tests leveraging the newly added `ENVIRONMENT_MODIFICATION` property. After creating a test, I run the following:

```cmake
set_tests_properties(
  ${test_name}
    PROPERTIES
      ENVIRONMENT_MODIFICATION PATH=path_list_append:${CMAKE_BINARY_DIR}
)

```

The value in the environment variable though is not appended, it’s entirely substituted.

A quick test

```auto
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv) {
    puts(getenv("PATH"));

    return 1;
}

```

shows if I run the executable with CTest, it only outputs the `CMAKE_BINARY_DIR` path, while running it after removing the `set_tests_properties` call prints as expected the contents of `PATH`.

I also tested the `string_append` OP and the result is the same. Tests were run on Windows 11 x64 w/cmake version 3.22.0-rc2.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [November 14, 2021, 5:37pm UTC](https://discourse.cmake.org/t/using-the-environment-modification-property/4479/2 "2021-11-14T17:37:43Z")

</div>

This was fixed in rc3: [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/6682](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6682)

Thanks for testing the rc releases!
