diff --git a/cmake/modules/FindSwiftXCTest.cmake b/cmake/modules/FindSwiftXCTest.cmake index 664e628..67443fb 100644 --- a/cmake/modules/FindSwiftXCTest.cmake +++ b/cmake/modules/FindSwiftXCTest.cmake @@ -126,8 +126,8 @@ function(add_swift_xctest test_target testee) # If the executable target depends on DLLs their directories need to be injected into the PATH # or they won't be found and the target will fail to run, so invoke it through cmake. Because COMMAND - ${CMAKE_COMMAND} -E env - "PATH=$;$ENV{PATH},;>" + ${CMAKE_COMMAND} -E env --modify + "$,PREPEND,PATH=>" -- $ -o ${test_main} ${sources} DEPENDS ${sources} GenerateXCTestMain @@ -150,7 +150,7 @@ function(add_swift_xctest test_target testee) # (and interpreted by CMake). [It] is then used to populate CTestTestfile.cmake, which is later # read by CTest to setup your test environment.” set_tests_properties(${test_target} - PROPERTIES ENVIRONMENT "PATH=$;${path},\\;>") + PROPERTIES ENVIRONMENT_MODIFICATION "$,PREPEND,PATH=>") endif()