1
/*=========================================================================
3
Program: Insight Segmentation & Registration Toolkit
4
Module: $RCSfile: cmTarget.h,v $
6
Date: $Date: 2001/12/11 07:17:53 $
7
Version: $Revision: 1.18 $
9
Copyright (c) 2001 Insight Consortium
12
Redistribution and use in source and binary forms, with or without
13
modification, are permitted provided that the following conditions are met:
15
* Redistributions of source code must retain the above copyright notice,
16
this list of conditions and the following disclaimer.
18
* Redistributions in binary form must reproduce the above copyright notice,
19
this list of conditions and the following disclaimer in the documentation
20
and/or other materials provided with the distribution.
22
* The name of the Insight Consortium, nor the names of any consortium members,
23
nor of any contributors, may be used to endorse or promote products derived
24
from this software without specific prior written permission.
26
* Modified source versions must be plainly marked as such, and must not be
27
misrepresented as being the original software.
29
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
30
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
33
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
=========================================================================*/
44
#include "cmStandardIncludes.h"
45
#include "cmCustomCommand.h"
46
#include "cmSourceFile.h"
49
* \brief Represent a library or executable target loaded from a makefile.
51
* cmTarget represents a target loaded from
57
enum TargetType { EXECUTABLE, WIN32_EXECUTABLE, STATIC_LIBRARY,
58
SHARED_LIBRARY, MODULE_LIBRARY, UTILITY, INSTALL_FILES,
62
* Return the type of target.
64
TargetType GetType() const
69
void SetType(TargetType f) { m_TargetType = f; }
72
* Indicate whether the target is part of the all target
74
bool IsInAll() const { return m_InAll; }
75
bool GetInAll() const { return m_InAll; }
76
void SetInAll(bool f) { m_InAll = f; }
79
* Get the list of the custom commands for this target
81
const std::vector<cmCustomCommand> &GetCustomCommands() const {return m_CustomCommands;}
82
std::vector<cmCustomCommand> &GetCustomCommands() {return m_CustomCommands;}
85
* Get the list of the source lists used by this target
87
const std::vector<std::string> &GetSourceLists() const
88
{return m_SourceLists;}
89
std::vector<std::string> &GetSourceLists() {return m_SourceLists;}
92
* Get the list of the source files used by this target
94
const std::vector<cmSourceFile> &GetSourceFiles() const
95
{return m_SourceFiles;}
96
std::vector<cmSourceFile> &GetSourceFiles() {return m_SourceFiles;}
99
* Get the list of the source files used by this target
101
enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
102
typedef std::vector<std::pair<std::string,LinkLibraryType> > LinkLibraries;
103
const LinkLibraries &GetLinkLibraries() const {return m_LinkLibraries;}
104
LinkLibraries &GetLinkLibraries() {return m_LinkLibraries;}
107
* Set the path where this target should be installed. This is relative to
110
std::string GetInstallPath() const {return m_InstallPath;}
111
void SetInstallPath(const char *name) {m_InstallPath = name;}
114
* Merge Link Libraries into this targets current list
116
void MergeLibraries(const LinkLibraries &ll);
119
* Generate the SourceFilesList from the SourceLists. This should only be
120
* done once to be safe.
122
void GenerateSourceFilesFromSourceLists(const cmMakefile &mf);
124
/** Add a utility on which this project depends. A utility is an executable
125
* name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
126
* commands. It is not a full path nor does it have an extension.
128
void AddUtility(const char* u) { m_Utilities.insert(u);}
129
///! Get the utilities used by this target
130
std::set<std::string>const& GetUtilities() const { return m_Utilities; }
133
std::vector<cmCustomCommand> m_CustomCommands;
134
std::vector<std::string> m_SourceLists;
135
TargetType m_TargetType;
136
std::vector<cmSourceFile> m_SourceFiles;
137
LinkLibraries m_LinkLibraries;
139
std::string m_InstallPath;
140
std::set<std::string> m_Utilities;
143
typedef std::map<cmStdString,cmTarget> cmTargets;