How to disable cmake Visual Studio macro, which prompts the user to reload the solution when changing CMakeLists.tx

Since Visual Studio 2010 is broken and will not automatically restart the solution when it changed externally through CMake, the guys from kitware made this macro that will offer you to reload the whole solution, rather than pushing a reload for each project, for example Visual Studio. That would be nice if it really worked.

In VC 10, this macro is broken and further blows up the ideal. I have another solution for automatically reloading externally modified projects / solutions (VSCommands add-in) and you want to disable the cmake macro. Does anyone know a way?

+6
source share
2 answers

To "disable" the CMake macro that runs to request a solution reload, you can edit the macro with the caption "DO NOT CHANGE THIS MACRO" ...

In Visual Studio, select "Tools> Macros> IDE Macros ..." from the menu, comment out the body of the "ReloadProjects" and "StopBuild" macros in the CMakeVSMacros2.Macros module, and then even when CMake calls these macros, they will have no effect.

Perhaps you could do this, and also try adding VS, mentioned in this CMake bug report, on the topic: http://public.kitware.com/Bug/view.php?id=11258#c27652

+3
source

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() 

This code seems to update the .sln file and forces Visual Studio to reload the entire solution at once, rather than asking you about each project.

+4
source

Source: https://habr.com/ru/post/900835/


All Articles