Warning, /graphics/kst-plot/INSTALL is written in an unsupported language. File is not indexed.
0001 ========================= 0002 Building Kst with CMake 0003 ========================= 0004 0005 Install CMake from www.cmake.org or your distribution (version >= 2.8). 0006 0007 0008 3rd party libraries 0009 ------------------- 0010 0011 Install Qt 4 and make sure qmake is found. 0012 Add the folder with qmake to the environment variable PATH. 0013 If you've compiled Qt by yourself or qmake is not found after 0014 installing Qt fix PATH, 0015 Linux/Unix: export PATH=<your path to qt>/bin:$PATH 0016 Windows : set PATH=<your path to qt>\bin;%PATH% 0017 0018 Libraries for plugins: 0019 Currently only Getdata, Gsl, and Netcdf are supported. 0020 On pkg systems the libraries should be found automatically, 0021 on non-pkg systems like Windows you must point to the libraries 0022 by environment variables NETCDF_DIR, GETDATA_DIR, and GSL_DIR. 0023 0024 0025 Generating build system files 0026 ----------------------------- 0027 0028 CMake is a build system file generator. On all systems it could 0029 generate files for several build systems, for instance Makefiles 0030 for make, project files for Visual Studio, Xcode, Eclipse. 0031 0032 Running cmake without any argument lists all supported build 0033 systems on your system. Passing one of them as -G"<build system name>" 0034 argument when running cmake selects this. 0035 0036 0037 Building out-of-source 0038 ---------------------- 0039 0040 The standard way of using CMake is to build in a folder which doesn't resides 0041 in the source tree. This has the advantage, that a complete fresh build could 0042 be done by simply deleting all files in the build folder and to re-run cmake 0043 again. 0044 0045 Another benefit of out-of-source builds is that several builds (debug, release, 0046 command-line builds, IDE project files) could all use the same source tree. 0047 0048 Therefore when using cmake create a folder outside of the source tree and 0049 select this folder when using CMake's GUI, cmake-gui, or go into this folder 0050 when you call cmake from the shell. 0051 0052 0053 Using cmake 0054 ------------- 0055 0056 When calling cmake you must pass the path to the source tree (absolute are relative) 0057 and optionally the generator (each system has its own default). Additional arguments 0058 could be passed with the -D prefix. 0059 0060 Here some examples, assuming the build folder is in the same folder as the source tree: 0061 0062 * Makefiles on Linux 0063 cmake ../kst 0064 0065 * Project files for QtCreator: 0066 Open the kst/CMakeLists.txt file and select the build folder 0067 or create the files in the command line using the -G"CodeBlocks *" option, eg 0068 cmake ../kst -G"CodeBlocks - Unix Makefiles" 0069 0070 * Project files for Xcode 0071 cmake ../kst -GXcode 0072 0073 * Project files for Visual Studio 10 0074 cmake ..\kst -G"Visual Studio 10" 0075 0076 * NMake files for Visual Studio 0077 cmake ..\kst -G"NMake Makefiles" 0078 0079 * Makefiles for MinGW 0080 cmake ..\kst -G"MinGW Makefiles" 0081 0082 0083 Daily work: 0084 0085 * Re-running cmake is simple 0086 cmake . 0087 0088 * Adding new files 0089 The cmake build system scans the directories, so no need to update any file, 0090 just re-run cmake. Also the mocing rules are generated. 0091 0092 * Unused source code file 0093 Because cmake scans the directories for *.cpp and *.h files it will also 0094 add files to the build system which are not mentioned to build. To exclude 0095 them change their ending and re-run cmake. 0096 0097 * Projects 0098 'make help' lists the available targets. 0099 0100 0101 Options 0102 ------- 0103 0104 Options could be passed by the -D prefix when running cmake. 0105 Available options will be listed on each cmake run. 0106 Here the options with their default value: 0107 0108 -- kst_version_string = 2.0.x : Version string. 0109 -- kst_release = OFF : Build release version: optimize for speed, don't embedded debug symbols. Toggle with '-Dkst_release=1' 0110 -- kst_deploy = OFF : Deploy into install dir. Toggle with '-Dkst_deploy=1' 0111 -- kst_merge_files = OFF : Merge files to speedup build about factor 5. Toggle with '-Dkst_merge_files=1' 0112 -- kst_merge_rebuild = OFF : Rebuild generated files from merged files build. Toggle with '-Dkst_merge_rebuild=1' 0113 -- kst_verbose = OFF : Make verbose CMake run and Makefiles. Toggle with '-Dkst_verbose=1' 0114 -- kst_install_prefix = /home/user/kst/INSTALLED : Install path for Kst, using a default if not set. 0115 -- kst_install_libdir = lib : Install directory name for libraries. 0116 -- kst_3rdparty = ON : Build plugins depending on 3rd party libraries. Toggle with '-Dkst_3rdparty=0' 0117 -- kst_dataobjects = ON : Build dataobject plugins. Toggle with '-Dkst_dataobjects=0' 0118 -- kst_test = OFF : Build unit tests. Toggle with '-Dkst_test=1' 0119 -- kst_pch = ON : Use precompiled headers. Toggle with '-Dkst_pch=0' 0120 -- kst_svnversion = ON : Use svnversion's output for Kst's version information. Toggle with '-Dkst_svnversion=0' 0121 -- kst_rpath = OFF : Use rpath. Toggle with '-Dkst_rpath=1' 0122 -- kst_3rdparty_build = OFF : Download and build 3rd party libraries. Toggle with '-Dkst_3rdparty_build=1' 0123 -- kst_3rdparty_download = OFF : Download precompiled 3rd party libraries. Toggle with '-Dkst_3rdparty_download=1' 0124 -- kst_console = OFF : Open console on Windows. Toggle with '-Dkst_console=1' 0125 -- kst_edit_cont = OFF : Enable "Edit and Continue" for Visual Studio. Toggle with '-Dkst_edit_cont=1' 0126 -- kst_python = OFF : Install Python support. Toggle with '-Dkst_python=1' 0127 -- kst_python_build = OFF : Download and build NumPy/SciPy then install Python support. Toggle with '-Dkst_python_build=1' 0128 0129 0130 To enable a option pass the value ON or 1, eg 0131 cmake ../kst -Dkst_merge_files=1 0132 0133 0134 Using the merged files build 0135 ----------------------------- 0136 0137 When the option 'kst_merge_files' is used then for each library a files 0138 is generated(merged_const.cpp) which includes all source files of this 0139 library, this speeds up compilation about factor 5. 0140 0141 When you heavily work on one file you could comment out the relevant 0142 define in the 'merged_const.cpp' file, so only the file 'merged_touched.cpp' 0143 file will be re-compiled again an again. 0144 0145 The CMake macro 'kst_dont_merge' is only active when the option 'kst_merge_files' 0146 is used. 'kst_dont_merge' prevents the adding of the listed files to the generated 0147 file, all listed files will be compiled separately. Sometimes this is needed because 0148 of too much compiler errors, and it is simpler not to merge the file. 0149 0150 - Adding new files 0151 When you add new files the merging files have to be rebuild: 0152 cmake -Dkst_merge_rebuild=1 . 0153 Or start over by completely cleaning the build folder. 0154 0155 - Starting over with same configuration 0156 Delete all files but CMakeCache.txt and call 0157 cmake . 0158 0159 0160 Packaging 0161 ---------- 0162 0163 - Source .tar.gz, .tar.bz2, .zip: 0164 make package_source 0165 0166 - Binary .tar.gz and install .sh: 0167 make package 0168 0169 - Binary .deb: 0170 create : cpack -G DEB --config CPackConfig.cmake 0171 list : dpkg-deb -c Kst-*.deb 0172 install: dpkg -i Kst-*.deb 0173 0174 - Binary .rpm: 0175 create : cpack -G RPM --config CPackConfig.cmake 0176 list : rpm -qlp Kst-*.rpm 0177 install: rpm -U Kst-*.rpm 0178 0179 - Binary .dmg 0180 make packages 0181 0182 0183 Status 0184 ------- 0185 0186 Kst builds, starts, and loads all plugins. Tested on Linux, 0187 Windows, and MacOSX. 0188 0189 Nice to have: 0190 - add pre-compiled headers for Mac, Xcode 0191 0192 0193 0194 Releasing 0195 ---------- 0196 0197 To build a release for Windows install the "Qt SDK for Windows" 0198 (it ships also MinGW) and call in the folder which contains the 0199 kst dir: 0200 0201 kst\misc\mingw-release-download-deps.bat <Kst version name> 0202 0203