Set the working directory of the testbed application when building with CMake for Visual Studio

This commit is contained in:
Daniel Chappuis 2016-01-09 17:45:55 +01:00
parent a12703b86d
commit a64d737f67
2 changed files with 25 additions and 0 deletions

View File

@ -89,6 +89,12 @@ SET(SCENES_SOURCES
scenes/concavemesh/ConcaveMeshScene.cpp
)
# Add .user file to set debug path in Visual Studio
SET(USER_FILE testbed.vcxproj.user)
SET(VS_USERFILE_WORKING_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH})
SET(OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${USER_FILE})
CONFIGURE_FILE(VisualStudioUserTemplate.user ${USER_FILE} @ONLY)
# Create the executable
ADD_EXECUTABLE(testbed ${TESTBED_SOURCES} ${SCENES_SOURCES} ${COMMON_SOURCES} ${IMGUI_SOURCES})

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>@VS_USERFILE_WORKING_DIRECTORY_DEBUG@</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
<LocalDebuggerWorkingDirectory>@VS_USERFILE_WORKING_DIRECTORY_DEBUG@</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">
<LocalDebuggerWorkingDirectory>@VS_USERFILE_WORKING_DIRECTORY_DEBUG@</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>@VS_USERFILE_WORKING_DIRECTORY_DEBUG@</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>