cmake_minimum_required(VERSION 3.26) project(vsdbg-fix) add_library(stub SHARED stub.cpp 3rdparty/hooker.c exports.def) set(DST_PATH "C:/Users/Fragcolor2/.cursor/extensions/ms-vscode.cpptools-1.21.6-win32-x64/debugAdapters/vsdbg/bin") # Set target name to vsdbg.dll set_target_properties(stub PROPERTIES OUTPUT_NAME vsdbg ) target_compile_definitions(stub PUBLIC _CRT_SECURE_NO_WARNINGS=1 HOOKER_X64=1 ) # Copy output dll to vsdbg directory add_custom_command( OUTPUT ${DST_PATH}/vsdbg.dll COMMAND ${CMAKE_COMMAND} -E copy $ ${DST_PATH} # Copy PDB too COMMAND ${CMAKE_COMMAND} -E copy $ ${DST_PATH} DEPENDS stub COMMENT "Copying vsdbg.dll to ${DST_PATH}" ) add_custom_target(copy_vsdbg ALL DEPENDS ${DST_PATH}/vsdbg.dll )