Output total time when using -j N
[cmake.git] / Source / cmExternalMakefileProjectGenerator.cxx
blob6d2377c0253399411f0e7d8428d7f854a234ac9a
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmExternalMakefileProjectGenerator.cxx,v $
5 Language: C++
6 Date: $Date: 2007-07-03 20:10:50 $
7 Version: $Revision: 1.2 $
9 Copyright (c) 2007 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #include <assert.h>
20 #include "cmExternalMakefileProjectGenerator.h"
22 std::string cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
23 const char* globalGenerator,
24 const char* extraGenerator)
26 std::string fullName;
27 if (globalGenerator)
29 if (extraGenerator && *extraGenerator)
31 fullName = extraGenerator;
32 fullName += " - ";
34 fullName += globalGenerator;
36 return fullName;
39 const char* cmExternalMakefileProjectGenerator::GetGlobalGeneratorName(
40 const char* fullName)
42 // at least one global generator must be supported
43 assert(!this->SupportedGlobalGenerators.empty());
45 if (fullName==0)
47 return 0;
50 std::string currentName = fullName;
51 // if we get only the short name, take the first global generator as default
52 if (currentName == this->GetName())
54 return this->SupportedGlobalGenerators[0].c_str();
57 // otherwise search for the matching global generator
58 for (std::vector<std::string>::const_iterator
59 it = this->SupportedGlobalGenerators.begin();
60 it != this->SupportedGlobalGenerators.end();
61 ++it)
63 if (this->CreateFullGeneratorName(it->c_str(), this->GetName())
64 == currentName)
66 return it->c_str();
69 return 0;