cmake_minimum_required(VERSION 3.10) project(mtfpdb) # Set the C++ standard set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED True) # Add the executable add_executable(mtfpdbtest main.cpp) # Set the build type to Debug to include debug information if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() # Optionally, you can set the build type to RelWithDebInfo for release builds with debug info set(CMAKE_BUILD_TYPE Debug) # Ensure that debug information is generated set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG") # Optionally, you can specify the output directory for the .pdb files set_target_properties(mtfpdbtest PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/RelWithDebInfo" PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/RelWithDebInfo" )