cbp2make
Makefile generation tool for Code::Blocks IDE
cbworkspace.h
Go to the documentation of this file.
1 /*
2  cbp2make : Makefile generation tool for the Code::Blocks IDE
3  Copyright (C) 2010-2013 Mirai Computing (mirai.computing@gmail.com)
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 //------------------------------------------------------------------------------
20 #ifndef CBWORKSPACE_H
21 #define CBWORKSPACE_H
22 //------------------------------------------------------------------------------
23 #include "stlstrings.h"
24 #include "cbproject.h"
25 //------------------------------------------------------------------------------
26 
27 class TiXmlElement;
28 class CToolChainSet;
29 
32 
34 {
35  friend class CCodeBlocksWorkspace;
37  private:
41  int m_Weight;
42  public:
43  void Clear(void);
44  void Read(const TiXmlElement* UnitRoot);
45  void Show(void);
46  bool LoadProject(const CString& WorkspacePath);
47  public:
48  CWorkspaceUnit(void);
49  ~CWorkspaceUnit(void);
50 };
51 
53 {
54  private:
56  std::vector<CWorkspaceUnit *> m_Units;
63  protected:
64  int CalculateProjectWeight(const size_t Index = 0);
65  void ResolveProjectDependencies(void);
66  void SortProjectsByWeight(void);
67  public:
68  void Clear(void);
69  void Read(const TiXmlElement* WorkspaceRoot);
70  bool LoadWorkspaceProjects(const CString& WorkspacePath);
71  bool LoadWorkspace(const CString& FileName);
72  void Show(const bool ShowProjects = false);
73  bool GenerateMakefile(const CString& FileName, CCodeBlocksBuildConfig& Config);
74  void GenerateMakefileText(const CString& FileName, CCodeBlocksBuildConfig& Config);
75  public:
77  ~CCodeBlocksWorkspace(void);
78 };
79 
80 #endif
81 //------------------------------------------------------------------------------
CStringList m_Depends
List of workspace unit dependencies.
Definition: cbworkspace.h:39
CString m_FileName
Workspace unit file name.
Definition: cbworkspace.h:38
CString m_Title
Title of the workspace.
Definition: cbworkspace.h:55
int m_Weight
Weight (priority) of the workspace unit.
Definition: cbworkspace.h:41
CStringList m_MakefileText
Contains plain text of makefile for the workspace.
Definition: cbworkspace.h:61
friend class CCodeBlocksWorkspace
Definition: cbworkspace.h:35
CStringList m_MakefilePaths
List of makefile paths of workspace units.
Definition: cbworkspace.h:59
CWorkspaceUnit(void)
Creates workspace unit.
Definition: cbworkspace.cpp:31
std::vector< CWorkspaceUnit * > m_Units
List of workspace units (projects) in the workspace.
Definition: cbworkspace.h:56
~CWorkspaceUnit(void)
Destroys workspace unit.
Definition: cbworkspace.cpp:36
Definition: stlstrings.h:98
Workspace description.
Definition: cbworkspace.h:52
CCodeBlocksProject m_Project
Contains project properties.
Definition: cbworkspace.h:40
Workspace unit description.
Definition: cbworkspace.h:33
CStringList m_MakefileNames
List of makefile names of workspace units.
Definition: cbworkspace.h:58
void Read(const TiXmlElement *UnitRoot)
Reads the workspace unit settings from an XML document.
Definition: cbworkspace.cpp:49
Definition: stlstrings.h:32
CStringList m_TargetDeps
List of dependencies of workspace units.
Definition: cbworkspace.h:60
void Show(void)
Prints the workspace unit contents to standard output.
Definition: cbworkspace.cpp:70
Build configuration.
Definition: cbbuildcfg.h:32
Makefile definition.
Definition: makefile.h:99
Manages a set of toolchains.
Definition: toolchains.h:146
void Clear(void)
Resets the workspace unit to the initial state.
Definition: cbworkspace.cpp:41
Project description.
Definition: cbproject.h:39
Project description.
bool LoadProject(const CString &WorkspacePath)
Loads the workspace unit (project) from file.
Definition: cbworkspace.cpp:87
CMakefile m_Makefile
Contains object-based makefile for the workspace.
Definition: cbworkspace.h:62
CStringList m_TargetNames
List of build target names of workspace units.
Definition: cbworkspace.h:57
Definition: cbworkspace.cpp:139