Skip to content

Latest commit

 

History

History
141 lines (95 loc) · 3.97 KB

BUILD.md

File metadata and controls

141 lines (95 loc) · 3.97 KB

Build and Package SlicerSALT

This document summarizes how to build and package SlicerSALT on Linux, macOS and Windows.

SlicerSALT is a custom Slicer application. Reading the 3D Slicer Developer Documentation may help answer additional questions.

The initial source files were created using KitwareMedical/SlicerCustomAppTemplate.

Prerequisites

Checkout

GNU/Linux systems & macOS

mkdir ~/Projects
cd ~/Projects
git clone https://github.com/Kitware/SlicerSALT.git SS

Windows

  1. Start Git Bash
  2. Checkout the source code into a directory C:\W\ by typing the following commands:
cd /c
mkdir W
cd /c/W
git clone https://github.com/Kitware/SlicerSALT.git SS

⚠️ use short source and build directory names to avoid the maximum path length limitation.

Build

GNU/Linux systems

cd ~/Projects/SSR
cmake \
  -DCMAKE_BUILD_TYPE:STRING=Release \
  -DQt5_DIR:PATH=/path/to/Qt/lib/cmake/Qt5 \
  ../SS

macOS

mkdir ~/Projects
cd ~/Projects
cmake \
  -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.13 \
  -DCMAKE_BUILD_TYPE:STRING=Release \
  -DQt5_DIR:PATH=/path/to/Qt/lib/cmake/Qt5 \
  ../SS

Windows

Option 1: CMake GUI and Visual Studio (Recommended)

  1. Start CMake GUI, select source directory C:\W\SS and set build directory to C:\W\SSR.
  2. Add an entry Qt5_DIR pointing to C:/Qt/${QT_VERSION}/${COMPILER}/lib/cmake/Qt5.
  3. Generate the project.
  4. Open C:\W\SSR\{{cookiecutter.project_name}}.sln, select Release and build the project.

Option 2: Command Line

  1. Start the Command Line Prompt
  2. Configure and build the project in C:\W\SSR by typing the following commands:
cd C:\W\
mkdir SSR
cd SSR
cmake -G "Visual Studio 16 2019" -A x64 -DQt5_DIR:PATH=`C:/Qt/${QT_VERSION}/${COMPILER}/lib/cmake/Qt5 ..\SS
cmake --build . --config Release -- /maxcpucount:4

Package

⚠️ Creating distributable packages is only supported for Release builds.

GNU/Linux systems & macOS

cd ~/Projects/SSR/Slicer-build
make package

macOS

⚠️ SlicerSALT will only create a valid package that will run on machines other than it’s built on if Qt was built from source.

cd ~/Projects/SSR/Slicer-build
make package

Windows

Install NSIS 2

Option 1: CMake and Visual Studio

  1. In the C:\W\SSR\Slicer-build directory, open Slicer.sln and build the PACKAGE target

Option 2: Command Line

  1. Start the Command Line Prompt
  2. Build the PACKAGE target by typing the following commands:
cd C:\W\SSR\Slicer-build
cmake --build . --config Release --target PACKAGE