diff options
author | Ken Martin <ken.martin@kitware.com> | 2005-02-22 14:12:10 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2005-02-22 14:12:10 (GMT) |
commit | 4d30cb309cc0cd191e89a7969599b79dea111a08 (patch) | |
tree | bf13c85d5880e0dca26c24240dbc17e267a2ec7e /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 832fa0e6091c5c574fc60bfd67e0cf982c3b33d8 (diff) | |
download | CMake-4d30cb309cc0cd191e89a7969599b79dea111a08.zip CMake-4d30cb309cc0cd191e89a7969599b79dea111a08.tar.gz CMake-4d30cb309cc0cd191e89a7969599b79dea111a08.tar.bz2 |
ENH: ctest now uses CMake global generator to do the build part of build-and-test
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 7f240c9..70a8c197 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -43,23 +43,19 @@ void cmGlobalVisualStudio7Generator::EnableLanguage(std::vector<std::string>cons this->cmGlobalGenerator::EnableLanguage(lang, mf); } -int cmGlobalVisualStudio7Generator::TryCompile(const char *, - const char *bindir, - const char *projectName, - const char *targetName, - std::string *output, - cmMakefile* mf) +int cmGlobalVisualStudio7Generator::Build( + const char *, + const char *bindir, + const char *projectName, + const char *targetName, + std::string *output, + const char *makeCommandCSTR, + const char *config, + bool clean) { // now build the test std::string makeCommand = - m_CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_MAKE_PROGRAM"); - if(makeCommand.size() == 0) - { - cmSystemTools::Error( - "Generator cannot find the appropriate make command."); - return 1; - } - makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str()); + cmSystemTools::ConvertToOutputPath(makeCommandCSTR); std::string lowerCaseCommand = makeCommand; cmSystemTools::LowerCase(lowerCaseCommand); @@ -80,8 +76,17 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *, #endif makeCommand += " "; makeCommand += projectName; - makeCommand += ".sln /build "; - if(const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION")) + makeCommand += ".sln "; + if(clean) + { + makeCommand += "/rebuild "; + } + else + { + makeCommand += "/build "; + } + + if(config && strlen(config)) { makeCommand += config; } @@ -90,7 +95,8 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *, makeCommand += "Debug"; } makeCommand += " /project "; - if (targetName) + + if (targetName && strlen(targetName)) { makeCommand += targetName; } @@ -109,6 +115,7 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *, cmSystemTools::ChangeDirectory(cwd.c_str()); return 1; } + *output += makeCommand; cmSystemTools::ChangeDirectory(cwd.c_str()); return retVal; } |