Core class specifies the basic static information for the CamiTK API. More...
#include <Core.h>
Static Public Member Functions | |
runtime directory information | |
static const QStringList | getComponentDirectories () |
get all the component directories. More... | |
static const QStringList | getActionDirectories () |
get all the action directories. More... | |
static const QStringList | getViewerDirectories () |
get all the viewers directories. More... | |
static const QString | getTestDataDir () |
Get a valid camitk test data directory name. More... | |
static const QStringList | getInstallDirectories (QString suffix, bool exitOnError=true) |
get all installation directories, suffixed by the given word. More... | |
static const QString | getConfig () |
get more information about installation, etc... More... | |
static const QString | getPaths () |
get all important paths More... | |
static const QString | getGlobalInstallDir () |
get the CAMITK_DIR (where camitk-config is installed) More... | |
static const QString | getUserInstallDir () |
get the user config directory (this is the local installation directory) More... | |
static const QString | getCurrentWorkingDir () |
get the current working directory (during dev, this should be the build directory, which is an installation directory) More... | |
static const QString | getBugReport () |
get a well formed bug report with all necessary information More... | |
runtime build information | |
get the type of build we are running, Debug or Release
| |
static const bool | isDebugBuild () |
Static Public Attributes | |
CamiTK Version variables set at configure time | |
complete version string | |
static const char * | version = "CamiTK 5.0.2" |
static const char * | shortVersion = "camitk-5.0" |
short version string (all in lower case, without the patch number) More... | |
static const char * | soVersion = "5" |
version used for so name More... | |
static const char * | debugPostfix = "-debug" |
debug postfix used on MSVC to distinguished between release and debug version More... | |
static const char * | libDir = "lib" |
library folder set depending on the compiler and environement choice (it could be lib/ or lib64/ on Linux). More... | |
Static Private Member Functions | |
static const QStringList | getExtensionDirectories (QString extensionType) |
Used by getInstallDirectories to determine the list of extension repositories This method check both Core::libDir and lib/ (if different) subdirectories in order to take multiarch into account. More... | |
Core class specifies the basic static information for the CamiTK API.
Extensions can only be in three different places:
Taking into account multiarch is difficult as some compiler/OS define CMAKE_INSTALL_LIBDIR to different values ("lib", "lib64" or even "lib/x86_64-linux-gnu" or more complicated paths). This value sometimes depends on where CMAKE_INSTALL_PATH points to (see CMake GNUInstallDirs module). For instance on debian, if CMAKE_INSTALL_PATH is equals to "/usr" then CMAKE_INSTALL_LIBDIR is set to "lib/ARCH", but if CMAKE_INSTALL_PATH is anything else, it is just set to "lib". The Core::libDir
variable is defined when CamiTK core is compiled (see CamiTKVersion.h.in
), but the CamiTK repositories are required also when a CamiTK application is launched.
The difficulty therefore arises as CamiTK has to load all type of extensions in all type of repositories and this must include:
Note that "lib/" was the only possible value of CMAKE_INSTALL_LIBDIR before multiarch was taken into account in CamiTK 5.0.
To take into account both situations, that result in a multitude of possible directories, it was decided that:
Core::libDir
or lib/
Core::libDir
is equal to lib/
must be taken into account to avoid duplicates
|
static |
get all the action directories.
It gets all the valid directories where actions are installed, and insert them in this particular order:
|
static |
get a well formed bug report with all necessary information
Referenced by main(), and GenerateBugReportProcess::run().
|
static |
get all the component directories.
It gets all the valid directories where components are installed, and insert them in this particular order:
Referenced by camitk::Application::open(), camitk::Application::openDirectory(), and camitk::Application::save().
|
static |
get more information about installation, etc...
Referenced by main().
|
static |
get the current working directory (during dev, this should be the build directory, which is an installation directory)
Referenced by camitk::Application::saveHistoryAsSXML().
|
staticprivate |
Used by getInstallDirectories to determine the list of extension repositories This method check both Core::libDir
and lib/
(if different) subdirectories in order to take multiarch into account.
extensionType | the type of extensions ("actions", "components" or "viewers") |
References getInstallDirectories(), and shortVersion.
|
static |
get the CAMITK_DIR (where camitk-config is installed)
References getUserInstallDir().
Referenced by main().
|
static |
get all installation directories, suffixed by the given word.
All the returned Strings are unique valid directories, sorted in this particular order:
It uses getExtensionDirectories() to take multiarch into account
If no directory is available and exitOnError is true, the application exits. There are situation (namely for checking testdata dir) where it not mandatory to find a directory. In this case, exitOnError should be set to false so that the application does not exit.
Referenced by getExtensionDirectories().
|
static |
|
static |
Get a valid camitk test data directory name.
It returns the first valid test data directory that is found. Checking is done in this particular order:
If none of this three directories is valid, return user's home directory.
A test data directory is valid if it exists and contains a least one file.
Referenced by camitk::Application::Application().
|
static |
get the user config directory (this is the local installation directory)
Referenced by getGlobalInstallDir().
|
static |
get all the viewers directories.
It gets all the valid directories where viewers are installed, and insert them in this particular order:
|
static |
|
static |
debug postfix used on MSVC to distinguished between release and debug version
|
static |
library folder set depending on the compiler and environement choice (it could be lib/ or lib64/ on Linux).
libDir value is set directly to the value of CMAKE_INSTALL_LIBDIR.
Although it can not be called a version variable per se, it is required for the extension manager to find the available extensions.
|
static |
short version string (all in lower case, without the patch number)
Referenced by getExtensionDirectories(), and main().
|
static |
version used for so name