README.md 4.2 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

5
Though CMB and its branded applications, such as aeva, are relatively simple to build,
David Thompson's avatar
David Thompson committed
6
they depend on many libraries including SMTK, Qt, ParaView/VTK, Boost, GDAL, ITK, and MOAB.
7
8
To help make the process of building CMB applications and the libraries they depend
on easier we have created a SuperBuild CMake Project.
9

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

David Thompson's avatar
David Thompson committed
12
* CMake version 3.12 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
David Thompson's avatar
David Thompson committed
18
  * Have Qt 5.12 or greater (5.15 recommended) installed on the system and make sure you set `USE_SYSTEM_qt5` on
Aron Helser's avatar
Aron Helser committed
19
  * In CMake: `QT5_DIR` needs to be set to [Qt installation dir for your compiler]/lib/cmake/Qt5
20
* C++ Compiler
Aron Helser's avatar
Aron Helser committed
21
22
23
24
  * XCode 9.x or greater
  * 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
* Ubuntu 16.04 specific
Aron Helser's avatar
Aron Helser committed
26
27
28
29
30
  * sudo apt-get install m4
  * sudo apt-get install build-essential
  * turn on `USE_SYSTEM_qt5` in CMake(Recommend)
    * sudo apt-get install qt5-qmake libqt5-dev qt5-dev-tools (if using system qt)
  * 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
39
40
41
42
There are currently two packages that can be built with this superbuild:

+ the base CMB ModelBuilder application, which is a generic pre-processing workflow tool, and
+ software for the annotation and exchange of virtual anatomy (aeva), which is a branded version
  of ModelBuilder aimed at medical annotation.

43
44
## Prepping the Git Repo

Ben Boeckel's avatar
Ben Boeckel committed
45
1. Clone the CMB SuperBuild Repo using `git clone https://gitlab.kitware.com/cmb/cmb-superbuild.git`
46
47
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`
Aron Helser's avatar
Aron Helser committed
48
4. If you will be changing the superbuild, run `./Scripts/setup-for-development.sh`
49
50

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

52
53
54
55
56
57
There are two possible methods you can use: CMake GUI or the ccmake command line tool.
In either case, decide which application packages (if any) you wish to build.

+ To build and package ModelBuilder, ensure the `ENABLE_cmb` CMake cache variable is set to `ON`
when running CMake as described below.
+ To build and package aeva, ensure the `ENABLE_aeva` CMake cache variable is set to `ON`.
Ben Boeckel's avatar
Ben Boeckel committed
58

59
### Using the CMake GUI
Ben Boeckel's avatar
Ben Boeckel committed
60

61
62
63
![](images/CmakeScreenShot.png)

1. Select the Source directory that contains the CMake SuperBuild Git Repo
Ben Boeckel's avatar
Ben Boeckel committed
64
65
66
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.
67
68

### Using ccmake commandline tool
Ben Boeckel's avatar
Ben Boeckel committed
69
70

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

### Configuring the CMB SuperBuild
Ben Boeckel's avatar
Ben Boeckel committed
76
77
78
79

* 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`.
80
* The process will also build Qt 5.9.1 by default.  If you already have a Qt
Ben Boeckel's avatar
Ben Boeckel committed
81
  installed (5.9 or newer) then you can do the following:
Aron Helser's avatar
Aron Helser committed
82
83
84
85
86
87
  * Turn `USE_SYSTEM_qt5` on
  * Tell CMake to configure
  * 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
88
89
* Tell CMake to configure
* Tell CMake to generate
90
91

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

93
94
95
96
* 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
97

98
* cd into the build directory
99
* run ctest -R cpack