Warning, /graphics/kst-plot/devel-docs/Kst2Specs/BuildSystemOverview is written in an unsupported language. File is not indexed.

0001 Kst Build System Overview
0002 
0003 The Kst build system is built using qmake.
0004 
0005 The build starts in /kst/kst.pro which triggers processing of each subdirectory triggering the named .pro that matches the subdirectory name.
0006 
0007 
0008 Building the Main Libraries (libkst, libkstmath, libkstapp, libwidgets)
0009 
0010   These libs are all built as lib, in windows as static libs, and have fairly straight forward .pro files.  All include /kst/kst.pri and pull many of their settings from it.
0011 
0012   Kst.pri
0013 
0014     Kst.pri configures the following details and is used by all libs and plugins.
0015 
0016     INSTALL_PREFIX - The installation location, also sets the default to /usr if not provided.
0017     INSTALL_LIBDIR - The installation lib location, also sets the default to lib if not provided.
0018     QMAKE_RPATH - The rpath is set if in debug mode to the lib/plugin locations.
0019     CONFIG - Debug mode is set if appropriate.
0020     VERSION - The version used by the build.
0021     DEFINES - The INSTALL_LIBDIR is exported as a define to be used at the code level.
0022 
0023 
0024 Building of the Executable
0025 
0026   The executable is built using the same Kst.pri settings as the libs and is very similar to the libs except that the base template used is app rather than lib.
0027 
0028   NOTE:  In /kst/kst/kst.pro the LIBS are set separately for windows compared to linux.  This is required due to linking errors on windows when in the standard order due to interdependencies between the libs.
0029 
0030 
0031 Building of DataSources
0032 
0033   DataSources are built starting in datasources.pro, This includes logic to determine which plugins will be built dependent on the system libraries that is determined by including config.pri
0034 
0035   config.pri
0036 
0037     config.pri provides the function libExists that is used to test whether required libraries are installed that allow the building of the libraries.
0038 
0039     Supports the testing for cfitsio, dirfile (getdata), and gsl but could easily be extended for more.
0040     Each library can be enabled for Windows or Disabled for linux.  If it is not disabled for Linux, pkgconfig is called to test if the library exists.  Only 
0041     if it can be found are the dependent plugins built.
0042 
0043   Building a DataSource
0044 
0045     Each datasource has it's own .pro file which includes kst.pri as well as datasourceplugin.pri which contains settings for all datasourceplugins.  The .pro file itself is very straightforward.
0046 
0047     datasourceplugin.pri
0048 
0049       datasourceplugin.pri is a straightforward grouping of settings used by datasources and serves to put them in a common location making updates easier.  It sets the template to lib and includes the plugin config.  It also includes the install settings and lib paths.
0050 
0051 
0052 Building of DataObject Plugins
0053 
0054   DataObject Plugins are built from plugins.pro, dataobject.pro, filters.pro and fits.pro.  Each make use of config.pri to determine which of the plugins can be built on the system.
0055 
0056   Building a DataObject Plugin
0057 
0058     Just like the DataSources each Dataobject Plugin has it's own .pro file which includes kst.pri as well as dataobjectplugin.pri which has settings specific to DataObject Plugins.
0059 
0060     dataobjectplugin.pri
0061 
0062       dataobjectplugin.pri is very straightforward and very similar to datasourceplugin.pri with the main difference being additional include paths as DataObject Plugins are permitted to make use of libkstmath, libkstapp and libwidgets which DataSource plugins do not have access to.
0063 
0064       It also includes the separate lib defines for windows / linux as references above under Building of the Executable. 
0065 
0066 
0067 Build of Tests
0068 
0069   The tests are built using a similiar configuration to the executable.  The config is qtestlib with the template being app to create the test application.  See NOTE from executable regarding lib order.
0070 
0071 
0072 
0073 Build System Scripts
0074 
0075   build-kst
0076 
0077     build-kst is the main build script for the system.  It is a basic script that does the following:
0078 
0079       1.  Parse parameter 1 for debug/release setting.  Default is release.
0080       2.  Parse parameter 2 for build output directory.
0081       3.  Create the build directory (PWD/build)
0082       4.  Enter the directory and run qmake on kst.pro
0083       5.  Run make (either using Icecream or directly).
0084 
0085   install-kst is a build and install script for the system.  It is very similiar to build-kst with a few added parameters to parse and a call to make install after build is complete.
0086 
0087       1.  Parse parameter 1 for debug/release setting.  Default is release.
0088       2.  Parse parameter 2 for INSTALL_PREFIX.  Default is /usr
0089       3.  Parse parameter 3 for INSTALL_LIBDIR.  Default is lib
0090       4.  Parse parameter 4 for build output directory.
0091       5.  Create the build directory (PWD/build)
0092       6.  Enter the directory and run qmake on kst.pro
0093       7.  Run make (either using Icecream or directly).
0094       8.  Run make install (either using Icecream or directly).
0095