Commit d30776eb authored by saubatn's avatar saubatn
Browse files

FIXED : Installer on Windows now build two targets in the start menu : imp and the wizard.

FIXED : missing DLL for dendencies
FIXED : shortcut icon for imp is now automatically created on the desktop when installed and removed when CamiTK is uninstalled.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@176 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 5802bf7c
......@@ -27,23 +27,32 @@
# dpkg --vextract package.deb subdirectory
#
# To produce a window installer with NSIS from linux, you need to install the nsis package (on ubuntu, type "sudo apt-get install nsis")
# To install NSIS on Window you need to complete manually in the regedit : HKEY_LOCAL_MACHINE\SOFTWARE\NSIS ---->pathdir de NSIS
# Be sure to use the makensisw.exe and not makensis.exe as the value of the MAKENSIS variable.
#
# 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
#
# string(TOLOWER ${CAMITK_PROJECT_NAME} CPACK_PACKAGE_NAME)
# set(CPACK_PACKAGE_VERSION_MAJOR ${CAMITK_VER_MAJ})
# set(CPACK_PACKAGE_VERSION_MINOR ${CAMITK_VER_MIN})
# set(CPACK_PACKAGE_VERSION_PATCH ${CAMITK_VER_PACKAGE_PAT})
# use the nickname of the package version
# set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CAMITK_VER_NICKNAME}")
# set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
# set(CPACK_PACKAGE_INSTALL_DIRECTORY "/")
#
# package name
string(TOLOWER ${CAMITK_PROJECT_NAME} CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_VERSION_MAJOR ${CAMITK_VER_MAJ})
set(CPACK_PACKAGE_VERSION_MINOR ${CAMITK_VER_MIN})
set(CPACK_PACKAGE_VERSION_PATCH ${CAMITK_VER_PACKAGE_PAT})
string(TOLOWER "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CAMITK_VER_NICKNAME}-${LSB_DISTRIB}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
# contact information
set(CPACK_PACKAGE_VENDOR "UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525")
set(CPACK_PACKAGE_CONTACT "http://camitk.imag.fr")
# resource files
set(CPACK_RESOURCE_FILE_README "${CAMITK_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CAMITK_SOURCE_DIR}/COPYING")
# executable
set(CPACK_PACKAGE_EXECUTABLES "imp" "imp" "wizard" "wizard")
# There is a "bug"/packaging problem with CMake 2.8.7 and 2.8.8 on ubuntu 12.04
# The package that is produced is corrupted.
# The workaround (see http://cmake.3232098.n2.nabble.com/Creating-package-td7577614.html )
......@@ -56,7 +65,11 @@
# mv data.tgz data.tar.gz
# ar rv camitk-3.0.0-blue-ubuntu12.04_amd64.deb data.tar.gz
SET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_NAME}\n ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
# Package information
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
if (UNIX AND NOT WIN32)
......@@ -151,10 +164,6 @@ if (UNIX AND NOT WIN32)
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
set(CPACK_SET_DESTDIR TRUE)
# Package information
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
# For building on a different system
# set(LSB_DISTRIB Ubuntu11.10)
......@@ -195,20 +204,16 @@ if (UNIX AND NOT WIN32)
set(CPACK_RESOURCE_FILE_README "${CAMITK_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CAMITK_SOURCE_DIR}/COPYING")
# executable
set(CPACK_PACKAGE_EXECUTABLES "imp" "CamiTK/imp")
#set(CPACK_INSTALL_CMAKE_PROJECTS "???"
# information description
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CAMITK_SOURCE_DIR}/README")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Computer Assisted Medical Intervention Took Kit.
CamiTK is a C++ framework that helps researchers and clinicians to easily and rapidly collaborate in order to prototype CAMI applications, that feature medical images, surgical navigation and biomechanical simulations.")
SET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_NAME}\n ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
# if(DPKG_FOUND)
# if(DPKG_FOUND)
# set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
# set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
# set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
......@@ -260,6 +265,15 @@ if(WIN32 AND NOT UNIX)
# -----------------------
# NSIS Windows installer
# -----------------------
# Update package name for windows release
set(LSB_DISTRIB "win32")
set(CPACK_PACKAGE_ARCHITECTURE i386)
string(TOLOWER "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CAMITK_VER_NICKNAME}-${LSB_DISTRIB}" CPACK_PACKAGE_FILE_NAME)
Message(status "CPACK_PACKAGE_FILE_NAME : ${CPACK_PACKAGE_FILE_NAME}")
# Try to find Makensis on Linux distribution
find_program(MAKENSIS
NAMES makensis
PATHS "/usr/bin"
......@@ -267,70 +281,111 @@ if(WIN32 AND NOT UNIX)
if(MAKENSIS)
# NSIS Windows installer
message(STATUS "Packaging nsis using ${MAKENSIS}: OK")
# set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
message(STATUS "Packaging nsis using ${MAKENSIS}")
# IMPORTANT !!!
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backslashes.
# include(GetPrerequisites)
# set(TARGET_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug)
# set(PREREQ "")
# get_prerequisites(${CAMITK_BIN_DIR}/Debug/imp.exe PREREQ 1 1 ${CAMITK_BIN_DIR} ${VTK_LIBRARY_DIRS}/Release)
# get_prerequisites(${TARGET_DIR}/${EXECNAME}.exe" PREREQ 0 1 ${TARGET_DIR} "")
# Get the list of shared library files required by <target>. The list
# in the variable named <prerequisites_var> should be empty on first
# entry to this function. On exit, <prerequisites_var> will contain the
# list of required shared library files.
# <target> is the full path to an executable file. <prerequisites_var>
# is the name of a CMake variable to contain the results.
# <exclude_system> must be 0 or 1 indicating whether to include or
# exclude "system" prerequisites. If <recurse> is set to 1 all
# prerequisites will be found recursively, if set to 0 only direct
# prerequisites are listed. <exepath> is the path to the top level
# executable used for @executable_path replacment on the Mac. <dirs> is
# a list of paths where libraries might be found: these paths are
# searched first when a target without any path info is given. Then
# standard system locations are also searched: PATH, Framework
# locations, /usr/lib...
#message(STATUS "PREREQ=${PREREQ}")
#set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${PREREQ})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
##TODO use GetPrerequisites.cmake (i.e. find a better way to list dependencies)
##get_prerequisites() is not well enough documented to justify the time investement - EP May 2011
# ${QT_BINARY_DIR}/QtCore4.dll
# ${QT_BINARY_DIR}/QtGui4.dll
# ${QT_BINARY_DIR}/QtSvg4.dll
# ${QT_BINARY_DIR}/QtXml4.dll
# ${QT_BINARY_DIR}/QtNetwork4.dll
# ${QT_BINARY_DIR}/QtSql4.dll
# ${QT_BINARY_DIR}/QtWebKit4.dll
# ${VTK_LIBRARY_DIRS}/Release/QVTK.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkCommon.dll
# ${VTK_LIBRARY_DIRS}/Release/vtksys.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkFiltering.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkGraphics.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkHybrid.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkIO.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkImaging.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkRendering.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkVolumeRendering.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkverdict.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkDICOMParser.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkNetCDF.dll
#${VTK_LIBRARY_DIRS}/Release/vtkmesh.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkexpat.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkjpeg.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkmetaio.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkpng.dll
# ${VTK_LIBRARY_DIRS}/Release/vtktiff.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkzlib.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkInfovis.dll
${QT_BINARY_DIR}/QtCore4.dll
${QT_BINARY_DIR}/QtGui4.dll
${QT_BINARY_DIR}/QtSvg4.dll
${QT_BINARY_DIR}/QtXml4.dll
${QT_BINARY_DIR}/QtNetwork4.dll
${QT_BINARY_DIR}/QtSql4.dll
${QT_BINARY_DIR}/QtWebKit4.dll
${VTK_LIBRARY_DIRS}/Release/QVTK.dll
${VTK_LIBRARY_DIRS}/Release/vtkCommon.dll
${VTK_LIBRARY_DIRS}/Release/vtksys.dll
${VTK_LIBRARY_DIRS}/Release/vtkFiltering.dll
${VTK_LIBRARY_DIRS}/Release/vtkGraphics.dll
${VTK_LIBRARY_DIRS}/Release/vtkHybrid.dll
${VTK_LIBRARY_DIRS}/Release/vtkIO.dll
${VTK_LIBRARY_DIRS}/Release/vtkImaging.dll
${VTK_LIBRARY_DIRS}/Release/vtkRendering.dll
${VTK_LIBRARY_DIRS}/Release/vtkVolumeRendering.dll
${VTK_LIBRARY_DIRS}/Release/vtkverdict.dll
${VTK_LIBRARY_DIRS}/Release/vtkDICOMParser.dll
${VTK_LIBRARY_DIRS}/Release/vtkNetCDF.dll
${VTK_LIBRARY_DIRS}/Release/vtkNetCDF_cxx.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkmesh.dll
${VTK_LIBRARY_DIRS}/Release/vtkexpat.dll
${VTK_LIBRARY_DIRS}/Release/vtkjpeg.dll
${VTK_LIBRARY_DIRS}/Release/vtkmetaio.dll
${VTK_LIBRARY_DIRS}/Release/vtkpng.dll
${VTK_LIBRARY_DIRS}/Release/vtktiff.dll
${VTK_LIBRARY_DIRS}/Release/vtkzlib.dll
${VTK_LIBRARY_DIRS}/Release/vtkInfovis.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkQtChart.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkfreetype.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkftgl.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkalglib.dll
# ${VTK_LIBRARY_DIRS}/Release/vtklibxml2.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkViews.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkexoIIc.dll
# ${VTK_LIBRARY_DIRS}/Release/vtkWidgets.dll
# )
${VTK_LIBRARY_DIRS}/Release/vtkfreetype.dll
${VTK_LIBRARY_DIRS}/Release/vtkftgl.dll
${VTK_LIBRARY_DIRS}/Release/vtkalglib.dll
${VTK_LIBRARY_DIRS}/Release/vtklibxml2.dll
${VTK_LIBRARY_DIRS}/Release/vtkViews.dll
${VTK_LIBRARY_DIRS}/Release/vtkexoIIc.dll
${VTK_LIBRARY_DIRS}/Release/vtkWidgets.dll
# Wizard dependencies
${XERCESC_ROOT_DIR}/bin/xerces-c_3_1.dll
)
##ITK is required
# FIND_PACKAGE(ITK)
# if (${ITK_FOUND})
# message(pass ${VTK_LIBRARY_DIRS})
# set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${ITK_DIR}/bin/Release/ITKCommon.dll)
# endif ()
if (${ITK_FOUND})
message(pass ${VTK_LIBRARY_DIRS})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${ITK_DIR}/bin/Release/ITKCommon.dll)
endif ()
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backslashes.
set(CAMITK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/core/icons\\\\appIcon.ico")
set(CPACK_PACKAGE_ICON ${CAMITK_PACKAGE_ICON})
set(CPACK_NSIS_MUI_ICON ${CAMITK_PACKAGE_ICON})
set(CPACK_NSIS_MUI_UNIICON ${CAMITK_PACKAGE_ICON})
# Application icon
set(CAMITK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\core\\\\icons\\\\appIcon.ico") #set here the current icon for CamiTK
set(CPACK_PACKAGE_ICON ${CAMITK_PACKAGE_ICON}) #icon for the top bar NSIS installer
set(CPACK_NSIS_MUI_ICON ${CAMITK_PACKAGE_ICON}) #icon for the generated install program (the .exe to run to install CamiTK).
set(CPACK_NSIS_MUI_UNIICON ${CAMITK_PACKAGE_ICON}) #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.
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut \\\"$DESKTOP\\\\${CAMITK_PROJECT_NAME}-imp.lnk\\\" \\\"$INSTDIR\\\\bin\\\\imp.exe\\\"")
# Tell CPack to remove the icons after uninstalling
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\${CAMITK_PROJECT_NAME}-imp.lnk\\\"")
# Installer name
set(CPACK_NSIS_DISPLAY_NAME "CamiTK ${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}.${CAMITK_VER_PACKAGE_PAT}")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_INSTALLED_ICON_NAME ${CAMITK_PROJECT_NAME})
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CAMITK_PROJECT_NAME})
set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\camitk.imag.fr")
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\camitk.imag.fr")
set(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
set(CPACK_NSIS_MODIFY_PATH ON)
include(InstallRequiredSystemLibraries)
else()
message(STATUS "Can not find makensis: nsis packaging is not possible")
......@@ -359,6 +414,7 @@ endif()
# -------------------------------------
include(InstallRequiredSystemLibraries)
# and here we go...
include(CPack)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment