Debian Codegraph @

devel-docs/Kst2Specs/BuildSystemOverview

raw
1 Kst Build System Overview
2
3 The Kst build system is built using qmake.
4
5 The build starts in /kst/kst.pro which triggers processing of each subdirectory triggering the named .pro that matches the subdirectory name.
6
7
8 Building the Main Libraries (libkst, libkstmath, libkstapp, libwidgets)
9
10 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.
11
12 Kst.pri
13
14 Kst.pri configures the following details and is used by all libs and plugins.
15
16 INSTALL_PREFIX - The installation location, also sets the default to /usr if not provided.
17 INSTALL_LIBDIR - The installation lib location, also sets the default to lib if not provided.
18 QMAKE_RPATH - The rpath is set if in debug mode to the lib/plugin locations.
19 CONFIG - Debug mode is set if appropriate.
20 VERSION - The version used by the build.
21 DEFINES - The INSTALL_LIBDIR is exported as a define to be used at the code level.
22
23
24 Building of the Executable
25
26 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.
27
28 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.
29
30
31 Building of DataSources
32
33 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
34
35 config.pri
36
37 config.pri provides the function libExists that is used to test whether required libraries are installed that allow the building of the libraries.
38
39 Supports the testing for cfitsio, dirfile (getdata), and gsl but could easily be extended for more.
40 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
41 if it can be found are the dependent plugins built.
42
43 Building a DataSource
44
45 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.
46
47 datasourceplugin.pri
48
49 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.
50
51
52 Building of DataObject Plugins
53
54 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.
55
56 Building a DataObject Plugin
57
58 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.
59
60 dataobjectplugin.pri
61
62 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.
63
64 It also includes the separate lib defines for windows / linux as references above under Building of the Executable.
65
66
67 Build of Tests
68
69 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.
70
71
72
73 Build System Scripts
74
75 build-kst
76
77 build-kst is the main build script for the system. It is a basic script that does the following:
78
79 1. Parse parameter 1 for debug/release setting. Default is release.
80 2. Parse parameter 2 for build output directory.
81 3. Create the build directory (PWD/build)
82 4. Enter the directory and run qmake on kst.pro
83 5. Run make (either using Icecream or directly).
84
85 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.
86
87 1. Parse parameter 1 for debug/release setting. Default is release.
88 2. Parse parameter 2 for INSTALL_PREFIX. Default is /usr
89 3. Parse parameter 3 for INSTALL_LIBDIR. Default is lib
90 4. Parse parameter 4 for build output directory.
91 5. Create the build directory (PWD/build)
92 6. Enter the directory and run qmake on kst.pro
93 7. Run make (either using Icecream or directly).
94 8. Run make install (either using Icecream or directly).
95