Skip to content

Commit d54232b

Browse files
committed
Set debugger working directory, so samples can be run out-of-the box with MSVC
1 parent b6b2bac commit d54232b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

attachments/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ function (add_chapter CHAPTER_NAME)
103103
target_link_libraries (${CHAPTER_NAME} Vulkan::cppm glfw)
104104
target_include_directories (${CHAPTER_NAME} PRIVATE ${STB_INCLUDEDIR})
105105

106+
if(WIN32)
107+
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
108+
set_target_properties(${CHAPTER_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${CHAPTER_NAME}")
109+
endif()
110+
endif()
111+
106112
if (DEFINED CHAPTER_SHADER)
107113
set (CHAPTER_SHADER_TARGET ${CHAPTER_NAME}_shader)
108114
file (GLOB SHADER_SOURCES ${CHAPTER_SHADER}.frag ${CHAPTER_SHADER}.vert ${CHAPTER_SHADER}.comp)

0 commit comments

Comments
 (0)