diff options
author | David Cole <david.cole@kitware.com> | 2007-11-16 12:01:58 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2007-11-16 12:01:58 (GMT) |
commit | 867de7fc670ffd67c9cb8dcffae42f87de7023ed (patch) | |
tree | febaeb64e474158b5289f31853b20cdcb396fe43 /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 0a001f1567dff13bb3441728b313b9fa7b2b1b11 (diff) | |
download | CMake-867de7fc670ffd67c9cb8dcffae42f87de7023ed.zip CMake-867de7fc670ffd67c9cb8dcffae42f87de7023ed.tar.gz CMake-867de7fc670ffd67c9cb8dcffae42f87de7023ed.tar.bz2 |
ENH: Add ability to call Visual Studio macros from CMake. Add a CMake Visual Studio macro to reload a solution file automatically if CMake makes changes to .sln files or .vcproj files. Add code to call the macro automatically for any running Visual Studio instances with the .sln file open at the end of the Visual Studio Generate call. Only call the macro if some .sln or .vcproj file changed during Generate. Also, add handling for REG_EXPAND_SZ type to SystemTools::ReadRegistryValue - returned string has environment variable references expanded.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 5136779..3556d79 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -16,8 +16,8 @@ =========================================================================*/ #include "windows.h" // this must be first to define GetCurrentDirectory #include "cmGlobalVisualStudio7Generator.h" -#include "cmLocalVisualStudio7Generator.h" #include "cmGeneratedFileStream.h" +#include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" #include "cmake.h" @@ -202,7 +202,7 @@ void cmGlobalVisualStudio7Generator::GenerateConfigurations(cmMakefile* mf) configs += ";"; configs += this->Configurations[i]; } - + mf->AddCacheDefinition( "CMAKE_CONFIGURATION_TYPES", configs.c_str(), @@ -219,6 +219,13 @@ void cmGlobalVisualStudio7Generator::Generate() // Now write out the DSW this->OutputSLNFile(); + + // If any solution or project files changed during the generation, + // tell Visual Studio to reload them... + if(!cmSystemTools::GetErrorOccuredFlag()) + { + this->CallVisualStudioReloadMacro(); + } } void cmGlobalVisualStudio7Generator @@ -241,11 +248,15 @@ void cmGlobalVisualStudio7Generator return; } this->WriteSLNFile(fout, root, generators); + if (fout.Close()) + { + this->FileReplacedDuringGenerate(fname); + } } // output the SLN file void cmGlobalVisualStudio7Generator::OutputSLNFile() -{ +{ std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it; for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) { |