1
/*=========================================================================
3
Program: CMake - Cross-Platform Makefile Generator
4
Module: $RCSfile: cmGlobalVisualStudioGenerator.cxx,v $
6
Date: $Date: 2008-07-31 15:52:24 $
7
Version: $Revision: 1.11.2.2 $
9
Copyright (c) 2002 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
=========================================================================*/
1
/*============================================================================
2
CMake - Cross Platform Makefile Generator
3
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5
Distributed under the OSI-approved BSD License (the "License");
6
see accompanying file Copyright.txt for details.
8
This software is distributed WITHOUT ANY WARRANTY; without even the
9
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
See the License for more information.
11
============================================================================*/
17
12
#include "cmGlobalVisualStudioGenerator.h"
19
14
#include "cmCallVisualStudioMacro.h"
34
29
//----------------------------------------------------------------------------
30
std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
32
std::string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
33
key += this->GetIDEVersion();
37
//----------------------------------------------------------------------------
35
38
void cmGlobalVisualStudioGenerator::Generate()
37
40
// Add a special target that depends on ALL projects for easy build
49
52
// Use no actual command lines so that the target itself is not
50
53
// considered always out of date.
51
gen[0]->GetMakefile()->
55
gen[0]->GetMakefile()->
52
56
AddUtilityCommand("ALL_BUILD", true, no_working_dir,
53
57
no_depends, no_commands, false,
54
58
"Build all projects");
59
// Now make all targets depend on the ALL_BUILD target
61
for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
64
cmTargets& targets = (*i)->GetMakefile()->GetTargets();
65
for(cmTargets::iterator t = targets.begin();
66
t != targets.end(); ++t)
68
if(!this->IsExcluded(gen[0], t->second))
70
allBuild->AddUtility(t->second.GetName());
360
379
cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target,
361
380
const char* name)
363
// Handle the external MS project special case.
364
if(strncmp(name, "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
367
// kind of weird removing the first 27 letters. my
368
// recommendatsions: use cmCustomCommand::GetCommand() to get the
369
// project name or get rid of the target name starting with
370
// "INCLUDE_EXTERNAL_MSPROJECT_" and use another indicator/flag
371
// somewhere. These external project names shouldn't conflict
372
// with cmake target names anyways.
376
382
// Possibly depend on an intermediate utility target to avoid
378
384
if(target.GetType() == cmTarget::STATIC_LIBRARY ||
405
411
//----------------------------------------------------------------------------
412
void cmGlobalVisualStudioGenerator::GetTargetSets(
413
TargetDependSet& projectTargets, TargetDependSet& originalTargets,
414
cmLocalGenerator* root, GeneratorVector const& generators
417
this->cmGlobalGenerator::GetTargetSets(projectTargets, originalTargets,
420
// Add alternative dependency targets created by FixUtilityDepends.
421
for(TargetDependSet::iterator ti = projectTargets.begin();
422
ti != projectTargets.end(); ++ti)
425
if(const char* altName = tgt->GetProperty("ALTERNATIVE_DEPENDENCY_NAME"))
427
if(cmTarget* alt = tgt->GetMakefile()->FindTarget(altName))
429
projectTargets.insert(alt);
435
//----------------------------------------------------------------------------
406
436
#include <windows.h>
408
438
//----------------------------------------------------------------------------
754
//----------------------------------------------------------------------------
756
cmGlobalVisualStudioGenerator::TargetCompare
757
::operator()(cmTarget const* l, cmTarget const* r) const
759
// Make sure ALL_BUILD is first so it is the default active project.
760
if(strcmp(r->GetName(), "ALL_BUILD") == 0)
764
if(strcmp(l->GetName(), "ALL_BUILD") == 0)
768
return strcmp(l->GetName(), r->GetName()) < 0;
771
//----------------------------------------------------------------------------
772
cmGlobalVisualStudioGenerator::OrderedTargetDependSet
773
::OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const& targets)
775
for(cmGlobalGenerator::TargetDependSet::const_iterator ti =
776
targets.begin(); ti != targets.end(); ++ti)