Because Visual Studio 2010 is broken and won't automatically reload a solution when it changed externally via CMake, the guys at kitware made this macro that prompts you to reload the whole solution instead of pressing reload for every project like Visual Studio does. This would be nice if it actually worked.
In VC 10 this macro is broken and further chokes the ide. I have another solution for automatically reloading externally changed projects/solutions (the VSCommands add-in) and would want to disable cmake's macro of doing so. Does anyone know a way?
The CMake support is directly integrated since Visual Studio 2017. This way, you can open folders with a CMakeLists. txt file directly via "File > Open > Folder". You will find more information at https://docs.microsoft.com/de-de/cpp/build/cmake-projects-in-visual-studio.
CMake is a better build system than Visual Studio projects and solutions. It is compact and much more easier to maintain even for Windows only projects. See CMake for Visual Studio Developers for some reasons.
Here is what i found in LLVM' CMakeLists.txt:
# Workaround for MSVS10 to avoid the Dialog Hell
# FIXME: This could be removed with future version of CMake.
if(MSVC_VERSION EQUAL 1600)
set(LLVM_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/LLVM.sln")
if( EXISTS "${LLVM_SLN_FILENAME}" )
file(APPEND "${LLVM_SLN_FILENAME}" "\n# This should be regenerated!\n")
endif()
endif()
It seems, this code updates .sln file and forces Visual Studio to reload whole solution at once, instead of asking you about each project.
To "disable" the CMake macro that runs to prompt for solution reloading, you could edit the macro labeled "DO NOT EDIT THIS MACRO"...
In Visual Studio, choose "Tools > Macros > Macros IDE..." from the menu, comment out the body of the "ReloadProjects" and "StopBuild" macros in the CMakeVSMacros2.Macros module, and then even when CMake calls those macros, they'll have no effect.
Perhaps you could do that, and also try the VS addin mentioned in this CMake bug report on the topic: http://public.kitware.com/Bug/view.php?id=11258#c27652
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With