Usage¶
CMB may be configured to use custom branding, such as icons, splash screens, and the about dialog, by setting properties for the project.
By default, the modelbuilder
application will be built, and the CMakeLists.txt and resources to do so can be found under the modelbuilder/
directory.
Properties¶
To set properties for CMB, use the cmb_set_property
API.
cmb_set_property(NAME "MyApplicationName")
Properties can be broken into three groups, Application, Resource, and Information.
Name | Default | Description |
---|---|---|
NAME |
modelbuilder |
Exported name of the appalication. |
APP_NAME |
<NAME> |
Name of the binary executable to build. |
VERSION |
<PROJECT_VERSION> |
Application version. |
TITLE |
<APP_NAME> <VERSION> <cmb_build_architecture>-bit |
Title that is displayed on top of the application window. |
ORGANIZATION |
Kitware Inc. |
Name of the organization that maintains the application. |
Application properties are used to configure how different system will display the application in menus:
Name | Default | Description |
---|---|---|
RESOURCE_DIR |
modelbuilder/ |
Change the directory for computing the default resources. |
SPLASH |
<RESOURCE_DIR>/<NAME>-splash.png |
Splash screen image |
ICON |
<RESOURCE_DIR>/<NAME>-icon.png |
Icon used for Unix like OSs |
WINDOWS_ICON |
<RESOURCE_DIR>/win32/<NAME>.ico |
Icon used when building for windows |
OSX_ICON |
<RESOURCE_DIR>/apple/<NAME>.incs |
Icon used when building for MacOS |
LINUX_ICON_SIZES |
22x22;32x32;96x96 |
List of icon sizes available for linux desktop |
LINUX_ICON_<SIZE> |
<RESOURCE_DIR>/unix/<NAME>-<SIZE>.png |
Icon associated with the given <SIZE> |
APP_DATA |
<RESOURCE_DIR>/unix/<NAME>.appdata.xml |
Application information for UNIX app |
Resource properties are used to direct the application to image and file resources:
Using the property RESOURCE_DIR
acts as a replacement for the default search path for resources that are not explicitly specified. The hierarchy for searching for resources is hard-coded and if a resource is not found it will result in an error.
Name | Default | Description |
---|---|---|
ORGANIZATION_URL |
https://www.kitware.com/ |
The URL to the organization webpage. |
WEBSITE_URL |
https://www.computationalmodelbuilder.com |
The URL to the application website. (Help->”Website”) |
USER_GUIDE_URL |
https://cmb.readthedocs.io/en/latest/ |
The URL to the User Guide for this application. (Help->”User’s guide and tutorials”) |
ISSUES_URL |
https://gitlab.kitware.com/groups/cmb/-/issues |
The URL to the bug reporting page. (Help->”Issue tracker”) |
Information Properties will show up under the help menu to populate links and/or by the ParaView client when building the application.
About Dialog¶
Overriding the help dialog requires a QObject class to be defined. A reasonable template to start from can be found in modelbuilder/mbAboutDialogReaction{.h,.cxx}
. To configure the About dialog use the cmb_configure_about_dialog
CMake API provided by CMB.
example:
cmb_configure_about_dialog(
CLASS_NAME mbAboutDialogReaction
SOURCES
mbAboutDialogReaction.cxx
mbAboutDialogReaction.h)
Default Layout Specification¶
Configure the default layout of the Qt dock widgets using the cmb_configure_layout_spec
CMake API. A reasonable template to start from can be found in modelbuilder/mbLayoutSpec{.h,.cxx}
.
example:
cmb_configure_layout_spec(
CLASS_NAME mbLayoutSpec
SOURCES
mbLayoutSpec.cxx
mbLayoutSpec.h)