diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 4f8d0bc169..73a212ee0b 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -213,8 +213,14 @@ function(ly_add_test) add_custom_target(${unaliased_test_name} COMMAND ${CMAKE_COMMAND} -E true ${args_TEST_COMMAND} ${args_TEST_ARGUMENTS}) file(RELATIVE_PATH project_path ${LY_ROOT_FOLDER} ${CMAKE_CURRENT_SOURCE_DIR}) + set(ide_path ${project_path}) + # Visual Studio doesn't support a folder layout that starts with ".." + # So strip away the parent directory of a relative path + if (${project_path} MATCHES [[^(\.\./)+(.*)]]) + set(ide_path "${CMAKE_MATCH_2}") + endif() set_target_properties(${unaliased_test_name} PROPERTIES - FOLDER "${project_path}" + FOLDER "${ide_path}" VS_DEBUGGER_COMMAND ${test_command} VS_DEBUGGER_COMMAND_ARGUMENTS "${test_arguments_line}" )