README.md 3.42 KB
Newer Older
Bob Obara's avatar
Bob Obara committed
1 2
<p style="text-align:center"><img src="images/CMBLogoSuperBuild.png" alt="CMB SuperBuild Logo" align="middle" style="width: 200px;"/> </p>

3 4
# CMB SuperBuild

Ben Boeckel's avatar
Ben Boeckel committed
5
Though CMB is relatively simple to build itself, it does depend on a several
6
libraries including Qt, ParaView/VTK, Boost, MOAB, etc.. To help make the process of
Ben Boeckel's avatar
Ben Boeckel committed
7 8
building CMB and the libraries it depends on easier we have created a
SuperBuild CMake Project.
9

Ben Boeckel's avatar
Ben Boeckel committed
10 11
# Requirements

12
* CMake version 3.9 or greater with SSL support (Binaries from `cmake.org`
13 14
  have this already; custom built CMake binaries need to use
  `CMAKE_USE_SYSTEM_CURL=ON`).
Ben Boeckel's avatar
Ben Boeckel committed
15
* ninja or make - (the Windows build requires ninja)
16
* Checkout of the [CMB SuperBuild Git Repo](https://gitlab.kitware.com/cmb/cmb-superbuild)
17
* Qt Related Info
18 19
 * Have Qt 5.10 or greater installed on the system and make sure you set `USE_SYSTEM_qt5` on
 * In CMake: `QT5_DIR` needs to be set to [Qt installation dir for your compiler]/lib/cmake/Qt5
20
* C++ Compiler
21
 * XCode 9.x or greater
22 23 24
 * GCC 4.9 or greater
 * Clang 3.4 or greater
 * Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)
Haocheng LIU's avatar
Haocheng LIU committed
25 26 27
* Ubuntu 16.04 specific
 * sudo apt-get install m4
 * sudo apt-get install build-essential
Ben Boeckel's avatar
Ben Boeckel committed
28 29
 * turn on `USE_SYSTEM_qt5` in CMake(Recommend)
  * sudo apt-get install qt5-qmake libqt5-dev qt5-dev-tools (if using system qt)
30
 * sudo apt-get install libxt-dev
31

Ben Boeckel's avatar
Ben Boeckel committed
32 33
Note that the build process will also download additional tarballs and
checkout additional git repos so you will also need an internet connection.
34 35

# Building CMB using the SuperBuild Process
Ben Boeckel's avatar
Ben Boeckel committed
36

37 38
## Prepping the Git Repo

Ben Boeckel's avatar
Ben Boeckel committed
39
1. Clone the CMB SuperBuild Repo using `git clone https://gitlab.kitware.com/cmb/cmb-superbuild.git`
40 41
2. Using a shell in the cloned repository check out the latest stable release `git checkout release`
3. Using a shell in the cloned repository, run `git submodule update --init`
42 43

## Configuring the Build Using CMake
Ben Boeckel's avatar
Ben Boeckel committed
44

45
There are two possible methods you can use: CMake GUI or the ccmake command line tool
Ben Boeckel's avatar
Ben Boeckel committed
46

47
### Using the CMake GUI
Ben Boeckel's avatar
Ben Boeckel committed
48

49 50 51
![](images/CmakeScreenShot.png)

1. Select the Source directory that contains the CMake SuperBuild Git Repo
Ben Boeckel's avatar
Ben Boeckel committed
52 53 54
2. Select the build directory to be used to hold the build.  Note that due to
   a bug in git this should not be under and git repository including the
   Source Directory.
55 56

### Using ccmake commandline tool
Ben Boeckel's avatar
Ben Boeckel committed
57 58

1. Make the directory you want to build in
59
2. cd into that directory
Ben Boeckel's avatar
Ben Boeckel committed
60 61
3. If you are building with ninja (as oppose to make) run
   `ccmake -G Ninja PathToYourSuperBuildRepo`, else omit the `-G Ninja`
62 63

### Configuring the CMB SuperBuild
Ben Boeckel's avatar
Ben Boeckel committed
64 65 66 67

* By default the build will be in Release Mode (not Debug) - this can be
  changed using the `CMAKE_BUILD_TYPE_cmb` variable. Similar variables exist
  for other projects depending on the setup including `paraview` and `smtk`.
68
* The process will also build Qt 5.9.1 by default.  If you already have a Qt
Ben Boeckel's avatar
Ben Boeckel committed
69 70
  installed (5.9 or newer) then you can do the following:
 * Turn `USE_SYSTEM_qt5` on
71
 * Tell CMake to configure
Ben Boeckel's avatar
Ben Boeckel committed
72 73 74 75
 * Check to see if the `Qt5_DIR` variable is set to the appropriate location -
   if is not then set it correctly
 * On Windows, the directory to the Qt5 libraries must be in the `PATH`
   environment variable in order to build.
Ben Boeckel's avatar
Ben Boeckel committed
76 77
* Tell CMake to configure
* Tell CMake to generate
78 79

## Building the CMB SuperBuild
Ben Boeckel's avatar
Ben Boeckel committed
80

81 82 83 84
* cd into the build directory
* run make or ninja - depending on which build system you previously selected.

## Building a CMB Installable Package
Ben Boeckel's avatar
Ben Boeckel committed
85

86
* cd into the build directory
87
* run ctest -R cpack