summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-25 13:38:29 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-25 13:38:29 (GMT)
commit0005d625a0f46e6071adfb394b82e5bf8c74a291 (patch)
treea40292954d27d409ffb5811912dfbbb2a8fc918b /Source
parentbb08b88cc4be791172801d0e6ffdae2a3691f413 (diff)
downloadCMake-0005d625a0f46e6071adfb394b82e5bf8c74a291.zip
CMake-0005d625a0f46e6071adfb394b82e5bf8c74a291.tar.gz
CMake-0005d625a0f46e6071adfb394b82e5bf8c74a291.tar.bz2
ENH: add special windows CMAKE_MSVCIDE_RUN_PATH variable for adding to the path of vs IDE for running custom commands from cmake
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx16
-rw-r--r--Source/cmLocalGenerator.cxx9
2 files changed, 24 insertions, 1 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index ff67fd0..f1bf776 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -40,6 +40,22 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons
// Create list of configurations requested by user's cache, if any.
this->cmGlobalGenerator::EnableLanguage(lang, mf);
this->GenerateConfigurations(mf);
+
+ // if this environment variable is set, then copy it to
+ // a static cache entry. It will be used by
+ // cmLocalGenerator::ConstructScript, to add an extra PATH
+ // to all custom commands. This is because the VS IDE
+ // does not use the environment it is run in, and this allows
+ // for running commands and using dll's that the IDE environment
+ // does not know about.
+ const char* extraPath = cmSystemTools::GetEnv("CMAKE_MSVCIDE_RUN_PATH");
+ if(extraPath)
+ {
+ mf->AddCacheDefinition("CMAKE_MSVCIDE_RUN_PATH",
+ extraPath, "Saved environment variable CMAKE_MSVCIDE_RUN_PATH",
+ cmCacheManager::STATIC);
+ }
+
}
std::string cmGlobalVisualStudio7Generator::GenerateBuildCommand(const char* makeProgram,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6ada0d9..988db36 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1726,7 +1726,14 @@ cmLocalGenerator::ConstructScript(const cmCustomCommandLines& commandLines,
script += this->Convert(workingDirectory, START_OUTPUT, SHELL);
script += newline;
}
-
+ const char* extraPath = this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH");
+ if(extraPath)
+ {
+ script += "set PATH=";
+ script += extraPath;
+ script += ";%PATH%";
+ script += newline;
+ }
// Write each command on a single line.
for(cmCustomCommandLines::const_iterator cl = commandLines.begin();
cl != commandLines.end(); ++cl)