Build instructions Windows - neutronimaging/imagingsuite GitHub Wiki

Needed software and tools

You need to install the following to be able to build the ImagingSuite on Windows using Qt6.2.x

  • git
  • Microsoft Visual studio 2019
  • Qt 6.2.x (greater versions will work, but I prefer the LTS version)
  • Anaconda
  • 7zip (for the packaging)
  • CMake, it is provided by both Qt and Visual Studio, so you don't need to install it separately.
  • conan 1.56 (downloaded as windows application. You could in principle also use pip install conan==1.56)

Note: You must create accounts and log in to use Visual Studio and Qt. It is possibly also needed to use Anaconda.

Set environment variables

The deployment relies on the following environment variables:

  • WORKSPACE - the path to the folder with git repositories. E.g., WORKSPACE=E:\git
  • QTBINPATH - the path to the Qt binaries for the used Qt versions. E.g., QTBINPATH=E:\Qt\6.2.4\msvc2019_64\bin

Clone the repositories

All sources are stored in the GitHub repository https://github.com/neutronimaging.

Use the git bash terminal to clone them:

cd <location of your repositories>
$git clone https://github.com/neutronimaging/imagingsuite.git
$git clone https://github.com/neutronimaging/ExternalDependencies.git
$git clone https://github.com/neutronimaging/TestData.git
$git clone https://github.com/neutronimaging/scripts.git

You could also clone

$git clone https://github.com/neutronimaging/KipTool.git
$git clone https://github.com/neutronimaging/nGITool.git
$git clone https://github.com/neutronimaging/NIQAtool.git

Building

Create needed folders for the build

  • Open a Powershell terminal
  • Navigate to the location of your repositories
  • Create some folders
mkdir build-imagingsuite
mkdir install
mkdir install\applications
mkdir install\lib
mkdir install\tests
mkdir deployed

Prepare the build

cd build-imagingsuite
conan install ..\imagingsuite\ --profile ..\imagingsuite\profiles\windows_msvc_16_release
activate.bat

After the build is completed, you should also deactivate the conan environment by typing:

deactivate.bat

Run cmake

cmake ..\imagingsuite\ -DCMAKE_INSTALL_PREFIX=..\install
cmake --build . --target install --config Release

The cmake configuration may need additional parameters to find the correct compiler, Qt, and python. Then the configuration call turns into

C:\Qt\Tools\CMake_64\bin\cmake.exe ..\imagingsuite\ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\Qt\6.2.2\msvc2019_64\lib\cmake\ -DCMAKE_INSTALL_PREFIX="../install/" -DCMAKE_MODULE_PATH="c:/Users/ander/source/repos/build-imagingsuite

You may also have to specify which compiler you use. This is done by adding the argument -G="Visual Studio 16 2019".

Note: I prefer to use the cmake from Qt as it is better prepared for Qt dependencies.

Deploy the built binaries.

Navigate to the sources folder. Note: You have to set the WORKSPACE environment variable to point to the right location for this script to work.

cd ../imagingsuite/deploy/win
deploymuhrec_cmake.bat