diff --git a/{{cookiecutter.project_name}}/BUILD_LINUX.md b/{{cookiecutter.project_name}}/BUILD_LINUX.md new file mode 100644 index 0000000..e06ecaa --- /dev/null +++ b/{{cookiecutter.project_name}}/BUILD_LINUX.md @@ -0,0 +1,47 @@ +# Build and Package {{cookiecutter.project_name}} + +This document summarizes how to build and package {{cookiecutter.project_name}} on Linux. + +{{cookiecutter.project_name}} is a custom Slicer application. Reading the [3D Slicer Developer Documentation](https://slicer.readthedocs.io/en/latest/developer_guide/index.html) may help answer additional questions. + +The initial source files were created using [KitwareMedical/SlicerCustomAppTemplate](https://github.com/KitwareMedical/SlicerCustomAppTemplate). + +## Clone + +```sh +git clone https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.github_project}}.git +``` + +## Prerequisites + +Install the prerequisites as described in the [Slicer documentation for building on Linux](https://slicer.readthedocs.io/en/latest/developer_guide/build_instructions/linux.html). This includes development tools, support libraries, and Qt. + +## Build + +Note: The build process can take hours. + +Build: + +```sh +cmake \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DQt5_DIR:PATH=/opt/qt/5.15.2/gcc_64/lib/cmake/Qt5 \ + -S {{cookiecutter.github_project}} \ + -B {{cookiecutter.github_project}}-SuperBuild-Release +cd {{cookiecutter.github_project}}-SuperBuild-Release +make -j +``` + +where `` is the number of parallel builds. As a rule of thumb, many use the `number of CPU threads - 1` as the number of parallel builds. +On Ubuntu 20.04, the default Qt5 packages are too old and so the Slicer documentation linked above should have suggested a method of installing Qt 5.15.2; +if you installed it to `/opt/qt`, for example, then an extra option like `-DQt5_DIR:PATH=/opt/qt/5.15.2/gcc_64/lib/cmake/Qt5` would be needed in the `cmake` command above. + +Once the application is built, there will be an _inner build_ inside the _superbuild_ folder, located at `{{cookiecutter.app_name}}-SuperBuild-Release/Slicer-build`. The application executable is contained in this _inner build_ folder. + +## Package + +From the _inner build_ folder: + +```sh +make package +``` diff --git a/{{cookiecutter.project_name}}/BUILD.md b/{{cookiecutter.project_name}}/BUILD_WINDOWS.md similarity index 88% rename from {{cookiecutter.project_name}}/BUILD.md rename to {{cookiecutter.project_name}}/BUILD_WINDOWS.md index e6cbdca..4cbe2e4 100644 --- a/{{cookiecutter.project_name}}/BUILD.md +++ b/{{cookiecutter.project_name}}/BUILD_WINDOWS.md @@ -16,9 +16,6 @@ The initial source files were created using [KitwareMedical/SlicerCustomAppTempl - Setup [your git username](https://help.github.com/articles/setting-your-username-in-git) and [your git email](https://help.github.com/articles/setting-your-email-in-git). - - If not already done, email `FirstName LastName ` to be granted access to - the [{{cookiecutter.github_organization}}/{{cookiecutter.github_project}}](https://github.com/{{cookiecutter.github_organization}}/{{cookiecutter.github_project}}) repository. - ## Checkout 1. Start `Git Bash` @@ -35,7 +32,7 @@ Note: use short source and build directory names to avoid the [maximum path leng ## Build -Note: The build process will take approximately 3 hours. +Note: The build process can take hours. Option 1: CMake GUI and Visual Studio (Recommended) diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md index 7056093..d1c54a7 100644 --- a/{{cookiecutter.project_name}}/README.md +++ b/{{cookiecutter.project_name}}/README.md @@ -16,6 +16,7 @@ _List key features_ ## Development - [Contributing](CONTRIBUTING.md) -- [Building](BUILD.md) +- [Building on Windows](BUILD_WINDOWS.md) +- [Building on Linux](BUILD_LINUX.md) ![{{cookiecutter.project_name}} by {{cookiecutter.org_name}}](Applications/{{cookiecutter.app_name}}App/Resources/Images/LogoFull.png?raw=true)