The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
More...
#include <ArmarXCore/core/system/cmake/CMakePackageFinder.h>
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
This class calls the CMake script FindPackageX.cmake to retrieve information about a specific ArmarX package. The CMake configuration file of a package is located in the getConfigDir() directory (source packages and installations).
The available variables and their values are written to stdout and parsed by CMakePackageFinder::_ParseString(). The values of the variables can be retieved via CMakePackageFinder::getVar() or their specific convenience functions like getBuildDir().
Definition at line 53 of file CMakePackageFinder.h.
◆ CMakePackageFinder()
CMakePackageFinder |
( |
const std::string & |
packageName, |
|
|
const std::filesystem::path & |
packagePath = "" , |
|
|
bool |
suppressStdErr = false , |
|
|
bool |
usePackagePathOnlyAsHint = false |
|
) |
| |
The package with name packageName is searched with cmake during construction of this class.
Query the values with the class functions.
- Parameters
-
packageName | Name of the ArmarX package to find. |
packagePath | Optional path to the package. Use if a specific instance of the package should be used. This needs to be the path where the ${packageName}Config.cmake is located, so for source packages the build dir. |
- See also
- getConfigDir()
Definition at line 236 of file CMakePackageFinder.cpp.
◆ _CreateSharedMutex()
void _CreateSharedMutex |
( |
| ) |
|
|
staticprotected |
◆ _ParseString()
bool _ParseString |
( |
const std::string & |
input, |
|
|
std::string & |
varName, |
|
|
std::string & |
content |
|
) |
| |
|
staticprotected |
◆ ExecCommand()
std::string ExecCommand |
( |
std::string |
command, |
|
|
int & |
result, |
|
|
bool |
suppressStdErr = false |
|
) |
| |
|
static |
◆ extractVariables()
std::vector< std::string > extractVariables |
( |
const std::string & |
cmakeVarString | ) |
|
|
protected |
◆ FindAllArmarXSourcePackages()
std::vector< std::string > FindAllArmarXSourcePackages |
( |
| ) |
|
|
static |
◆ FindPackageIncludePathList()
std::vector< std::string > FindPackageIncludePathList |
( |
const std::string & |
packageName | ) |
|
|
static |
Static function to find the include path with cmake.
Does use cmake built in functions and not the ArmarX cmake find script.
- Parameters
-
- Returns
Definition at line 312 of file CMakePackageFinder.cpp.
◆ FindPackageIncludePaths()
std::string FindPackageIncludePaths |
( |
const std::string & |
packageName | ) |
|
|
static |
◆ FindPackageLibs()
std::string FindPackageLibs |
( |
const std::string & |
packageName | ) |
|
|
static |
◆ getArmarXCMakeTempDir()
std::string getArmarXCMakeTempDir |
( |
| ) |
|
|
static |
return the path where the temporary cmake files are stored that are automically created by cmake.
If username available returns /tmp/armarxcmake-$username, otherwise /tmp.
Definition at line 609 of file CMakePackageFinder.cpp.
◆ getBinaryDir()
std::string getBinaryDir |
( |
| ) |
const |
|
inline |
◆ getBuildDir()
std::string getBuildDir |
( |
| ) |
const |
|
inline |
◆ getCMakeDir()
std::string getCMakeDir |
( |
| ) |
const |
|
inline |
◆ getComponentExecutableNames()
std::vector< std::string > getComponentExecutableNames |
( |
| ) |
const |
◆ getConfigDir()
std::string getConfigDir |
( |
| ) |
const |
|
inline |
Returns the path needed to find this package with cmake, i.e.
the dir where ${PACKAGENAME}Config.cmake resides.
Definition at line 102 of file CMakePackageFinder.h.
◆ getDataDir()
std::string getDataDir |
( |
| ) |
const |
|
inline |
◆ getDependencies()
std::vector< std::string > getDependencies |
( |
| ) |
const |
◆ getDependencyPaths()
std::map< std::string, std::string > getDependencyPaths |
( |
| ) |
const |
◆ getExecutables()
std::string getExecutables |
( |
| ) |
const |
◆ getIncludePathList()
std::vector< std::string > getIncludePathList |
( |
| ) |
const |
◆ getIncludePaths()
std::string getIncludePaths |
( |
| ) |
const |
|
inline |
◆ getInterfacePaths()
std::string getInterfacePaths |
( |
| ) |
const |
|
inline |
Returns the path to the slice (*.ice) files of a package.
- Note
- The generated slice files are relative getIncludePaths() with the same directory structure.
Definition at line 172 of file CMakePackageFinder.h.
◆ getLibraryPaths()
std::string getLibraryPaths |
( |
| ) |
const |
|
inline |
◆ getLibs()
std::string getLibs |
( |
| ) |
const |
|
inline |
◆ getName()
std::string getName |
( |
| ) |
const |
Returns the name of the given package.
Same name as given in constructor.
Definition at line 480 of file CMakePackageFinder.cpp.
◆ getPackageDir()
std::string getPackageDir |
( |
| ) |
const |
|
inline |
Returns the top level path of a source package.
Does not work for installed packages, so use with caution. To get the package config dir, e.g. for cmake, use getConfigDir().
Definition at line 144 of file CMakePackageFinder.h.
◆ getScenariosDir()
std::string getScenariosDir |
( |
| ) |
const |
|
inline |
◆ getStatechartsDir()
std::string getStatechartsDir |
( |
| ) |
const |
|
inline |
◆ getVar()
std::string getVar |
( |
const std::string & |
varName | ) |
const |
Returns the content of a CMake variable.
Usually there exists a dedicated function for all variables e.g. getIncludePaths()
- Parameters
-
varName | Name of the CMake Variable |
- Returns
- Content of the variable.
Definition at line 495 of file CMakePackageFinder.cpp.
◆ getVars()
const std::map< std::string, std::string > & getVars |
( |
| ) |
const |
◆ packageFound()
bool packageFound |
( |
| ) |
const |
◆ ReplaceCMakePackageFinderVars()
bool ReplaceCMakePackageFinderVars |
( |
std::string & |
string | ) |
|
|
static |
Replaces occurrences like $C{PACKAGE_NAME:VAR_NAME} with their CMakePackageFinder value.
E.g. $C{ArmarXCore:BINARY_DIR} could be replaced with /home/user/armarx/ArmarXCore/build/bin.
- Parameters
-
string | Contents in this string will be replaced. |
- Returns
- True if something was replaced.
Definition at line 630 of file CMakePackageFinder.cpp.
◆ found
◆ packageName
◆ vars
std::map<std::string, std::string> vars |
|
protected |
The documentation for this class was generated from the following files: