Computer Assited Medical Intervention Tool Kit  version 4.1
Functions

CamiTK CMake macros used to create package of the CamiTK project (a custom CEP or the CamiTK project itself). More...

Functions

 camitk_cep_packaging ()
 CamiTK cep packaging allows you to build a package from a CEP If README and COPYRIGHT files exists at top source dir, then they will be included in the source package. More...
 
 camitk_communityedition_packaging ()
 ==================== Source Tar ball ==================== More...
 

Detailed Description

CamiTK CMake macros used to create package of the CamiTK project (a custom CEP or the CamiTK project itself).

Function Documentation

◆ camitk_cep_packaging()

camitk_cep_packaging ( )

CamiTK cep packaging allows you to build a package from a CEP If README and COPYRIGHT files exists at top source dir, then they will be included in the source package.

Usage:

camitk_cep_packaging(DESCRIPTION "CEP package description"
[NAME packageName]
[VENDOR vendorName]
[CONTACT contactName]
[LICENSE "This is the license text..."]
)
Parameters
NAME(optional) Specify the package name (default is project name)
VENDOR(optional) Specify the vendor name (default is TIMC-IMAG)
CONTACT(optional) Specify the contact name (default is link to CamiTK website)
LICENSE(optional) Specify the license test

When configuring CMake, do not forget to set the CMAKE_INSTALL_PREFIX correctly (e.g., /usr on Linux) It will always use the CamiTK install directory as install prefix (install where the core is already)

To generate deb package add this to the cmake configuration line: -DCPACK_BINARY_DEB:BOOL=TRUE To generate rpm package add this to the cmake configuration line: -DCPACK_BINARY_RPM:BOOL=TRUE

◆ camitk_communityedition_packaging()

camitk_communityedition_packaging ( )

==================== Source Tar ball ====================

To make a source tar ball, use the custom target "camitk-ce-package-source"

  • make camitk-ce-package-source (it generates the correct CamiTKVersion.h) WARNING it is VERY important to use "make camitk-ce-package-source" and NOT just "make package_source"

==================== Windows User Package ====================

To make an installer (setup.exe) for the user package:

  • configure cmake with -DPACKAGING_NSIS:BOOL=TRUE (on windows AND unix)
  • use the custom target camitk-package, e.g "make camitk-package"

On Windows platforms CMake configure command (from the build directory) : cmake -DCMAKE_GENERATOR="Visual Studio 12 Win64" -DPACKAGING_NSIS=TRUE -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DAPPLICATION_CEPGENERATOR=FALSE -DAPPLICATION_TESTACTIONS=FALSE -DAPPLICATION_TESTCOMPONENTS=FALSE -DAPPLICATION_WIZARD=FALSE ../src Launch the camitkcommunityedition.sln visual studio solution file. Build all in Release (do it again if some .h files missing errors occured) Build camitk-package target.

On windows for the NSIS packager, to generate different components that can be opt out at install time, see http://www.itk.org/Wiki/CMake:Component_Install_With_CPack

More generally see http://www.itk.org/Wiki/CMake:CPackConfiguration

==================== Linux User Package ====================

On UNIX platforms cmake -DCMAKE_SKIP_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCEP_IMAGING:BOOL=TRUE -DCEP_MODELING:BOOL=TRUE -DPACKAGING_NSIS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX=/usr

On debian/ubuntu, you need to have package "dpkg" (to build DEB packages) and package "rpm" (to build RPM packages) installed: apt-get install dpkg rpm

To check the content of a deb package: dpkg –contents package.deb To install the content of a deb in a subdirectory instead of system-wide: dpkg –vextract package.deb subdirectory

There is a bug deb package (cmake 2.8.9 on Debian Wheezy): permission for directories are not rights Here is how to fix it (inspired from https://github.com/paralect/robomongo/blob/master/install/linux/fixup_deb.sh.in ) set PACKAGE_FILENAME="camitk-3.3.0-debian-7.x-wheezy_amd64.deb" cd /tmp mkdir camitk-deb dpkg-deb -x $PACKAGE_FILENAME camitk-deb dpkg-deb –control $PACKAGE_FILENAME camitk-deb/DEBIAN rm $PACKAGE_FILENAME find camitk-deb -type d -print0 |xargs -0 chmod 755 find camitk-deb -name "*.1" -print0 |xargs -0 chmod 0644 find fix_up_deb/usr/bin -name "camitk-*" -print0 |xargs -0 chmod 0755 fakeroot dpkg -b camitk-deb $PACKAGE_FILENAME rm -rf camitk-deb

package name

contact information

resource files

executable

CamiTK package description

Files to ignore during generation of the package

Detect processor bits range (32bits / 64bits) not the whole architecture (ARM ...).


Unix packages (Ubuntu and Debian)

Note : even if not packaging for Unix with NSIS, the CMake variable PACKAGING_NSIS is used here to indicate we are packaging (i.e. building the camitk-package target).

Try to find architecture

Try to find distro name and distro-specific arch

debian section

Find DPKG

Add paths here

Packaging requires ITK

set the package generator

For Debian-based distribs we want to create DEB packages.

We need to alter the architecture names as per distro rules

Set the dependencies based on the distrib version

Installation path Set the install location to "/usr" PLEASE, set the CamiTK install root path in your CMake command line / GUI (and not directly here)

Dependencies depending on the Operating System. Ubuntu12.xx WARNING Beware to the syntax of the Debian package dependencies, else it won't manage to install.

All these ubuntu version dependencies are the same, only one package is needed for all

Debian dependencies

Debian Wheezy

package name


Packaging for Windows

NSIS must be installed on the computer

Update package name for windows release

64 bits installer

32 bits installer

64bits installer

Qt libraries

VTK libraries

ITK library

GDCM libraries

32bits installer

Qt libraries

VTK libraries set(VTK_DIR ${VTK_DIR}/../../bin)

ITK Library

GDCM libraries

end compiler specific settings

Additional libraries to install with the installer

By default, do not warn when built on machines using only VS Express:

Tell CMake to copy CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS content into the package

Application icon

set here the current icon for CamiTK

icon for the top bar NSIS installer

icon for the generated install program (the .exe to run to install CamiTK).

icon for the generated uninstall program (the .exe to run to uninstall CamiTK).

Create desktop icons, by forcing CPack to build an internal command, as 'set(CPACK_NSIS_MODIFY_PATH ON)' option setted in the additional page doesn't work.

Tell CPack to remove the icons after uninstalling

Installer name


Mac App Bundle

TODO test this!

Libraries are bundled directly

Bundle Properties

Set up CPack configuration

Create the groups that will contains the installer components


CamiTK specific packaging targets

create specific target for package source When packaging, copy the CamiTKPackageVersion.h file to the source directory Don't forget to remove it immediatly after packaging.

This target create the installer / linux package. On windows, you have configured with PACKAGING_NSIS=TRUE => all project names have their "-" replaced by "_" character NSIS doesn't support "-" character.

References endif(), execute_process(), get_filename_component(), and include().