PhoenixGenerator  2.0.0
Set of tools to generate code
PCMakeListsGenerator.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __PCMAKELISTSGENERATOR_H__
8 #define __PCMAKELISTSGENERATOR_H__
9 
10 #include <fstream>
11 #include "PPath.h"
12 
15  public:
16  PCMakeLibrary();
17  PCMakeLibrary(const PCMakeLibrary & other);
18  virtual ~PCMakeLibrary();
19  PCMakeLibrary & operator = (const PCMakeLibrary & other);
20  void setName(const PString & name);
21  void setInstallDirectory(const PPath & installDirectory);
22  void setListLibDependecies(const PVecString & listLibDependecies);
23  void setListSources(const PVecPath & listSources);
24  void setListHeaders(const PVecPath & listHeaders);
25  void setRemoveDefinitions(const PString & removeDefinitions);
26  void setAddDefinitions(const PString & addDefinitions);
27  void setOtherCommandAfter(const PString & otherCommandAfter);
28  void setIsShared(bool isShared);
29  void setWantGenerateFindPackage(bool wantGenerateFindPackage);
30  const PString & getName() const;
31  PString & getName();
32  const PPath & getInstallDirectory() const;
34  const PVecString & getListLibDependecies() const;
36  const PVecPath & getListSources() const;
38  const PVecPath & getListHeaders() const;
40  const PString & getRemoveDefinitions() const;
42  const PString & getAddDefinitions() const;
44  const PString & getOtherCommandAfter() const;
46  bool getIsShared() const;
47  bool & getIsShared();
48  bool getWantGenerateFindPackage() const;
50  protected:
51  void copyPCMakeLibrary(const PCMakeLibrary & other);
52  private:
71  bool p_isShared;
74 };
75 
78  public:
80  PCMakeExecutable(const PCMakeExecutable & other);
81  virtual ~PCMakeExecutable();
83  void setName(const PString & name);
84  void setInstallDirectory(const PPath & installDirectory);
85  void setListDependecies(const PVecString & listDependecies);
86  void setListSources(const PVecPath & listSources);
87  void setRemoveDefinitions(const PString & removeDefinitions);
88  void setAddDefinitions(const PString & addDefinitions);
89  void setOtherCommandAfter(const PString & otherCommandAfter);
90  void setWantGenerateFindPackage(bool wantGenerateFindPackage);
91  const PString & getName() const;
92  PString & getName();
93  const PPath & getInstallDirectory() const;
95  const PVecString & getListDependecies() const;
97  const PVecPath & getListSources() const;
99  const PString & getRemoveDefinitions() const;
101  const PString & getAddDefinitions() const;
103  const PString & getOtherCommandAfter() const;
105  bool getWantGenerateFindPackage() const;
107  protected:
108  void copyPCMakeExecutable(const PCMakeExecutable & other);
109  private:
127 };
128 
131  public:
134  virtual ~PCMakeListsGenerator();
136  void setProjectName(const PString & projectName);
137  void setCmakeModulePath(const PPath & cmakeModulePath);
138  void setListPackage(const PVecString & listPackage);
139  void setListIncludeDirectories(const PVecPath & listIncludeDirectories);
140  void setListLinkDirecories(const PVecPath & listLinkDirecories);
141  void setListLibraries(const std::vector<PCMakeLibrary> & listLibraries);
142  void setListExecutable(const std::vector<PCMakeExecutable> & listExecutable);
143  void setTestDirectory(const PPath & testDirectory);
144  const PString & getProjectName() const;
146  const PPath & getCmakeModulePath() const;
148  const PVecString & getListPackage() const;
150  const PVecPath & getListIncludeDirectories() const;
152  const PVecPath & getListLinkDirecories() const;
154  const std::vector<PCMakeLibrary> & getListLibraries() const;
155  std::vector<PCMakeLibrary> & getListLibraries();
156  const std::vector<PCMakeExecutable> & getListExecutable() const;
157  std::vector<PCMakeExecutable> & getListExecutable();
158  const PPath & getTestDirectory() const;
160  protected:
162  private:
175  std::vector<PCMakeLibrary> p_listLibraries;
177  std::vector<PCMakeExecutable> p_listExecutable;
180 };
181 
182 
183 
184 #endif
185 
std::vector< PPath > PVecPath
Definition: PPath.h:75
std::vector< PString > PVecString
Definition: PString.h:96
Describes a CMake executable.
void setListSources(const PVecPath &listSources)
Sets the listSources of the PCMakeExecutable.
virtual ~PCMakeExecutable()
Destructor of class PCMakeExecutable.
void setName(const PString &name)
Sets the name of the PCMakeExecutable.
const PString & getName() const
Gets the name of the PCMakeExecutable.
void setOtherCommandAfter(const PString &otherCommandAfter)
Sets the otherCommandAfter of the PCMakeExecutable.
bool getWantGenerateFindPackage() const
Gets the wantGenerateFindPackage of the PCMakeExecutable.
PString p_addDefinitions
String to pass to the add_definitions.
PString p_removeDefinitions
String to pass to the remove_definitions.
void copyPCMakeExecutable(const PCMakeExecutable &other)
Copy Function of class PCMakeExecutable.
void setAddDefinitions(const PString &addDefinitions)
Sets the addDefinitions of the PCMakeExecutable.
const PVecString & getListDependecies() const
Gets the listDependecies of the PCMakeExecutable.
PVecString p_listDependecies
List of the executable libraries dependencies.
const PPath & getInstallDirectory() const
Gets the installDirectory of the PCMakeExecutable.
void setInstallDirectory(const PPath &installDirectory)
Sets the installDirectory of the PCMakeExecutable.
void initialisationPCMakeExecutable()
Initialisation Function of class PCMakeExecutable.
const PString & getOtherCommandAfter() const
Gets the otherCommandAfter of the PCMakeExecutable.
const PString & getRemoveDefinitions() const
Gets the removeDefinitions of the PCMakeExecutable.
PPath p_installDirectory
Name of the install directory of the executable.
void setWantGenerateFindPackage(bool wantGenerateFindPackage)
Sets the wantGenerateFindPackage of the PCMakeExecutable.
PCMakeExecutable()
Constructor of class PCMakeExecutable.
PCMakeExecutable & operator=(const PCMakeExecutable &other)
Operator = of class PCMakeExecutable.
const PString & getAddDefinitions() const
Gets the addDefinitions of the PCMakeExecutable.
PVecPath p_listSources
Lists of the sources.
void setRemoveDefinitions(const PString &removeDefinitions)
Sets the removeDefinitions of the PCMakeExecutable.
PString p_otherCommandAfter
Other command after the definition of the target.
const PVecPath & getListSources() const
Gets the listSources of the PCMakeExecutable.
void setListDependecies(const PVecString &listDependecies)
Sets the listDependecies of the PCMakeExecutable.
PString p_name
Name of the executable.
bool p_wantGenerateFindPackage
True if we want to have the CMake find_package file generated for the given executable.
Describes a CMake library.
const PPath & getInstallDirectory() const
Gets the installDirectory of the PCMakeLibrary.
const PVecString & getListLibDependecies() const
Gets the listLibDependecies of the PCMakeLibrary.
const PVecPath & getListHeaders() const
Gets the listHeaders of the PCMakeLibrary.
void setWantGenerateFindPackage(bool wantGenerateFindPackage)
Sets the wantGenerateFindPackage of the PCMakeLibrary.
void setInstallDirectory(const PPath &installDirectory)
Sets the installDirectory of the PCMakeLibrary.
bool p_isShared
True if the library is chared false if not.
void setListHeaders(const PVecPath &listHeaders)
Sets the listHeaders of the PCMakeLibrary.
const PVecPath & getListSources() const
Gets the listSources of the PCMakeLibrary.
PCMakeLibrary()
Constructor of class PCMakeLibrary.
void setName(const PString &name)
Sets the name of the PCMakeLibrary.
void setRemoveDefinitions(const PString &removeDefinitions)
Sets the removeDefinitions of the PCMakeLibrary.
bool p_wantGenerateFindPackage
True if we want to have the CMake find_package file generated for the given lib.
PCMakeLibrary & operator=(const PCMakeLibrary &other)
Operator = of class PCMakeLibrary.
const PString & getName() const
Gets the name of the PCMakeLibrary.
void setIsShared(bool isShared)
Sets the isShared of the PCMakeLibrary.
const PString & getRemoveDefinitions() const
Gets the removeDefinitions of the PCMakeLibrary.
bool getWantGenerateFindPackage() const
Gets the wantGenerateFindPackage of the PCMakeLibrary.
PVecPath p_listSources
Lists of the sources.
PString p_otherCommandAfter
Other command after the definition of the target.
PVecPath p_listHeaders
Lists of the headers.
PString p_name
Name of the library.
bool getIsShared() const
Gets the isShared of the PCMakeLibrary.
PVecString p_listLibDependecies
List of the library libraries dependencies.
const PString & getOtherCommandAfter() const
Gets the otherCommandAfter of the PCMakeLibrary.
void setListLibDependecies(const PVecString &listLibDependecies)
Sets the listLibDependecies of the PCMakeLibrary.
PPath p_installDirectory
Name of the install directory of the library.
void initialisationPCMakeLibrary()
Initialisation Function of class PCMakeLibrary.
virtual ~PCMakeLibrary()
Destructor of class PCMakeLibrary.
void setOtherCommandAfter(const PString &otherCommandAfter)
Sets the otherCommandAfter of the PCMakeLibrary.
void copyPCMakeLibrary(const PCMakeLibrary &other)
Copy Function of class PCMakeLibrary.
void setAddDefinitions(const PString &addDefinitions)
Sets the addDefinitions of the PCMakeLibrary.
const PString & getAddDefinitions() const
Gets the addDefinitions of the PCMakeLibrary.
void setListSources(const PVecPath &listSources)
Sets the listSources of the PCMakeLibrary.
PString p_removeDefinitions
String to pass to the remove_definitions.
PString p_addDefinitions
String to pass to the add_definitions.
Describes a CMakeLists.txt file.
const PPath & getCmakeModulePath() const
Gets the cmakeModulePath of the PCMakeListsGenerator.
PVecPath p_listLinkDirecories
Lists of the link directories.
const PVecPath & getListIncludeDirectories() const
Gets the listIncludeDirectories of the PCMakeListsGenerator.
void setListPackage(const PVecString &listPackage)
Sets the listPackage of the PCMakeListsGenerator.
const PVecPath & getListLinkDirecories() const
Gets the listLinkDirecories of the PCMakeListsGenerator.
void setListLibraries(const std::vector< PCMakeLibrary > &listLibraries)
Sets the listLibraries of the PCMakeListsGenerator.
void setListLinkDirecories(const PVecPath &listLinkDirecories)
Sets the listLinkDirecories of the PCMakeListsGenerator.
void setTestDirectory(const PPath &testDirectory)
Sets the testDirectory of the PCMakeListsGenerator.
const PPath & getTestDirectory() const
Gets the testDirectory of the PCMakeListsGenerator.
PVecString p_listPackage
List of the packages dependencies.
void initialisationPCMakeListsGenerator()
Initialisation Function of class PCMakeListsGenerator.
const std::vector< PCMakeExecutable > & getListExecutable() const
Gets the listExecutable of the PCMakeListsGenerator.
std::vector< PCMakeExecutable > p_listExecutable
List of the executable.
PString p_projectName
Name of the project.
const PVecString & getListPackage() const
Gets the listPackage of the PCMakeListsGenerator.
void setListExecutable(const std::vector< PCMakeExecutable > &listExecutable)
Sets the listExecutable of the PCMakeListsGenerator.
void setListIncludeDirectories(const PVecPath &listIncludeDirectories)
Sets the listIncludeDirectories of the PCMakeListsGenerator.
PCMakeListsGenerator & operator=(const PCMakeListsGenerator &other)
Operator = of class PCMakeListsGenerator.
PVecPath p_listIncludeDirectories
Lists of the include directories.
void copyPCMakeListsGenerator(const PCMakeListsGenerator &other)
Copy Function of class PCMakeListsGenerator.
void setProjectName(const PString &projectName)
Sets the projectName of the PCMakeListsGenerator.
void setCmakeModulePath(const PPath &cmakeModulePath)
Sets the cmakeModulePath of the PCMakeListsGenerator.
PPath p_testDirectory
Test sub-directory.
std::vector< PCMakeLibrary > p_listLibraries
List of the libraries.
const PString & getProjectName() const
Gets the projectName of the PCMakeListsGenerator.
PPath p_cmakeModulePath
CMAKE_MODULE_PATH variable.
virtual ~PCMakeListsGenerator()
Destructor of class PCMakeListsGenerator.
PCMakeListsGenerator()
Constructor of class PCMakeListsGenerator.
const std::vector< PCMakeLibrary > & getListLibraries() const
Gets the listLibraries of the PCMakeListsGenerator.
Path of a directory or a file.
Definition: PPath.h:17
Extends the std::string.
Definition: PString.h:16