![]() |
PhoenixGenerator
2.0.0
Set of tools to generate code
|
#include "cmakelist_generator.h"
Go to the source code of this file.
Functions | |
PString | getCMakeListsHeader () |
Get the CMakeLists.txt header. More... | |
PString | getFindPackageFileName (const PString &libName) |
Gets the name of the find_package cmake macro with the library name. More... | |
PString | getFullLibraryName (const PCMakeLibrary &cmakeLib) |
Gets the name of the library binary file. More... | |
bool | saveCMakeExecutable (std::ofstream &fs, const PCMakeExecutable &cmakeExecutable) |
Saves a cmake executable in a file. More... | |
bool | saveCMakeIncludeDirectories (std::ofstream &fs, const PVecPath &listIncludeDirectories) |
Saves the list of include directories. More... | |
bool | saveCMakeLibrary (std::ofstream &fs, const PCMakeLibrary &cmakeLib) |
Saves a cmake library in a file. More... | |
bool | saveCMakeLibraryFindPackageFile (const PCMakeLibrary &cmakeLib, const PPath &extraFileName, const PPath &extraPreviousFileName) |
Saves the find_package cmake macro with the library file. More... | |
bool | saveCMakeLinkDirectories (std::ofstream &fs, const PVecPath &listLinkDirectories) |
Saves the list of link directories. More... | |
bool | saveCMakeListsGenerator (const PPath &fileName, const PCMakeListsGenerator &cmakeGenerator) |
Saves the PCMakeListsGenerator. More... | |
bool | saveCMakeListsGenerator (std::ofstream &fs, const PCMakeListsGenerator &cmakeGenerator) |
Saves the PCMakeListsGenerator. More... | |
bool | saveCMakeUsePackages (std::ofstream &fs, const PVecString &listPackages) |
Saves the list of packages dependencies. More... | |
void | saveFindPackageHeader (std::ofstream &fs, const PString &libPrefix, const PVecPath &listHeader) |
Saves the finder of the header. More... | |
void | saveFindPackageLibrary (std::ofstream &fs, const PString &libPrefix, const PString &libName, const PString &fullNameLibrary) |
Saves the check for the binary library. More... | |
PString getCMakeListsHeader | ( | ) |
Get the CMakeLists.txt header.
Definition at line 12 of file cmakelist_generator.cpp.
Referenced by project_generator_cmakeListsMain(), project_generator_cmakeListsSrc(), project_generator_cmakeListsTest(), project_generator_gitlabci(), project_wrapper_classTest(), project_wrapper_generator_pyprojectToml(), project_wrapper_generator_setuppy(), and saveClassTestCMakeLists().
Gets the name of the find_package cmake macro with the library name.
libName | : library name |
Definition at line 32 of file cmakelist_generator.cpp.
References PString::toUpper().
Referenced by saveCMakeLibraryFindPackageFile(), and saveCMakeListsGenerator().
PString getFullLibraryName | ( | const PCMakeLibrary & | cmakeLib | ) |
Gets the name of the library binary file.
cmakeLib | : library |
Definition at line 41 of file cmakelist_generator.cpp.
References PCMakeLibrary::getIsShared(), and PCMakeLibrary::getName().
Referenced by saveCMakeLibraryFindPackageFile().
bool saveCMakeExecutable | ( | std::ofstream & | fs, |
const PCMakeExecutable & | cmakeExecutable | ||
) |
Saves a cmake executable in a file.
[out] | fs | : file to complete |
cmakeExecutable | : cmake executable we want to save in the file |
Definition at line 209 of file cmakelist_generator.cpp.
References PCMakeExecutable::getAddDefinitions(), PCMakeExecutable::getInstallDirectory(), PCMakeExecutable::getListDependecies(), PCMakeExecutable::getListSources(), PCMakeExecutable::getName(), PCMakeExecutable::getOtherCommandAfter(), and PCMakeExecutable::getRemoveDefinitions().
Referenced by saveCMakeListsGenerator().
bool saveCMakeIncludeDirectories | ( | std::ofstream & | fs, |
const PVecPath & | listIncludeDirectories | ||
) |
Saves the list of include directories.
[out] | fs | : file to complete |
listIncludeDirectories | : list of include directories |
Definition at line 266 of file cmakelist_generator.cpp.
Referenced by saveCMakeListsGenerator().
bool saveCMakeLibrary | ( | std::ofstream & | fs, |
const PCMakeLibrary & | cmakeLib | ||
) |
Saves a cmake library in a file.
[out] | fs | : file to complete |
cmakeLib | : cmake library we want to save in the file |
Definition at line 159 of file cmakelist_generator.cpp.
References PCMakeLibrary::getAddDefinitions(), PCMakeLibrary::getInstallDirectory(), PCMakeLibrary::getIsShared(), PCMakeLibrary::getListHeaders(), PCMakeLibrary::getListLibDependecies(), PCMakeLibrary::getListSources(), PCMakeLibrary::getName(), PCMakeLibrary::getOtherCommandAfter(), PCMakeLibrary::getRemoveDefinitions(), PCMakeLibrary::getWantGenerateFindPackage(), saveCMakeLibraryFindPackageFile(), and PString::toUpper().
Referenced by saveCMakeListsGenerator().
bool saveCMakeLibraryFindPackageFile | ( | const PCMakeLibrary & | cmakeLib, |
const PPath & | extraFileName, | ||
const PPath & | extraPreviousFileName | ||
) |
Saves the find_package cmake macro with the library file.
cmakeLib | : library we want to generate the cmake find_package macro |
extraFileName | : extra filename, its content will be put after the generated find |
extraPreviousFileName | : extra filename, its content will be put before the generated find |
Definition at line 129 of file cmakelist_generator.cpp.
References getFindPackageFileName(), getFullLibraryName(), PCMakeLibrary::getListHeaders(), PCMakeLibrary::getName(), PCMakeLibrary::getWantGenerateFindPackage(), PPath::loadFileContent(), saveFindPackageHeader(), saveFindPackageLibrary(), and PString::toUpper().
Referenced by saveCMakeLibrary().
bool saveCMakeLinkDirectories | ( | std::ofstream & | fs, |
const PVecPath & | listLinkDirectories | ||
) |
Saves the list of link directories.
[out] | fs | : file to complete |
listLinkDirectories | : list of link directories |
Definition at line 282 of file cmakelist_generator.cpp.
Referenced by saveCMakeListsGenerator().
bool saveCMakeListsGenerator | ( | const PPath & | fileName, |
const PCMakeListsGenerator & | cmakeGenerator | ||
) |
Saves the PCMakeListsGenerator.
fileName | : name of the file we want to write |
cmakeGenerator | : PCMakeListsGenerator we want to save |
Definition at line 298 of file cmakelist_generator.cpp.
bool saveCMakeListsGenerator | ( | std::ofstream & | fs, |
const PCMakeListsGenerator & | cmakeGenerator | ||
) |
Saves the PCMakeListsGenerator.
[out] | fs | : file to complete |
cmakeGenerator | : PCMakeListsGenerator we want to save |
Definition at line 316 of file cmakelist_generator.cpp.
References PCMakeListsGenerator::getCmakeModulePath(), getFindPackageFileName(), PCMakeListsGenerator::getListExecutable(), PCMakeListsGenerator::getListIncludeDirectories(), PCMakeListsGenerator::getListLibraries(), PCMakeListsGenerator::getListLinkDirecories(), PCMakeListsGenerator::getListPackage(), PCMakeListsGenerator::getProjectName(), PCMakeListsGenerator::getTestDirectory(), saveCMakeExecutable(), saveCMakeIncludeDirectories(), saveCMakeLibrary(), saveCMakeLinkDirectories(), and saveCMakeUsePackages().
bool saveCMakeUsePackages | ( | std::ofstream & | fs, |
const PVecString & | listPackages | ||
) |
Saves the list of packages dependencies.
[out] | fs | : file to complete |
listPackages | : list of packages dependencies |
Definition at line 252 of file cmakelist_generator.cpp.
Referenced by saveCMakeListsGenerator().
void saveFindPackageHeader | ( | std::ofstream & | fs, |
const PString & | libPrefix, | ||
const PVecPath & | listHeader | ||
) |
Saves the finder of the header.
[out] | fs | : file to complete |
libPrefix | : prefix of the variables | |
listHeader | : list of the header we want to search |
Definition at line 55 of file cmakelist_generator.cpp.
References PString::isSameBegining(), and PString::replace().
Referenced by saveCMakeLibraryFindPackageFile().
void saveFindPackageLibrary | ( | std::ofstream & | fs, |
const PString & | libPrefix, | ||
const PString & | libName, | ||
const PString & | fullNameLibrary | ||
) |
Saves the check for the binary library.
[out] | fs | : file to complete |
libPrefix | : prefix of the cmake variables | |
libName | : name of the library (target name without lib or .so) | |
fullNameLibrary | : name of the binary library |
Definition at line 94 of file cmakelist_generator.cpp.
References PString::replace().
Referenced by saveCMakeLibraryFindPackageFile().