Commit 255d0708 authored by saubatn's avatar saubatn
Browse files

UPDATE CPack configuration for 3.0.0 release.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@146 ec899d31-69d1-42ba-9299-647d76f65fb3
parent c0c24655
......@@ -4,9 +4,9 @@
set(CAMITK_PROJECT_NAME "CamiTK")
# Version (major, minor, patch)
set (CAMITK_VER_MAJ "2")
set (CAMITK_VER_MIN "1")
set (CAMITK_VER_NICKNAME "emerald")
set (CAMITK_VER_MAJ "3")
set (CAMITK_VER_MIN "0")
set (CAMITK_VER_NICKNAME "blue")
set (CAMITK_VER_PACKAGE_PAT "0") # patch version for package, change when appropriate
string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}" CAMITK_SHORT_VERSION_STRING)
......
......@@ -30,25 +30,18 @@
#
# 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})
# 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 "/")
# 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 "/")
set(CPACK_PACKAGE_VENDOR "UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525")
set(CPACK_PACKAGE_CONTACT "http://camitk.imag.fr")
set(CPACK_RESOURCE_FILE_README "${CAMITK_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CAMITK_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_EXECUTABLES "imp" "CamiTK/imp")
#set(CPACK_INSTALL_CMAKE_PROJECTS "???"
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CAMITK_SOURCE_DIR}/README")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CamiTK: Computer Assisted Medical Intervention Took Kit")
SET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_NAME}\n ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
if (UNIX AND NOT WIN32)
set(CPACK_GENERATOR "DEB") # "RPM")
......@@ -71,11 +64,27 @@ ${CPACK_SOURCE_IGNORE_FILES}
# Debian packages
# ----------------
if (UNIX AND NOT WIN32)
message(STATUS "Packaging CamiTK for UNIX systems")
# Try to find architecture
execute_process(COMMAND uname -m OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE)
string(STRIP "${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_ARCHITECTURE)
# Try to find distro name and distro-specific arch
execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE LSB_ID)
execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE LSB_RELEASE)
string(STRIP "${LSB_ID}" LSB_ID)
string(STRIP "${LSB_RELEASE}" LSB_RELEASE)
set(LSB_DISTRIB "${LSB_ID}${LSB_RELEASE}")
if(NOT LSB_DISTRIB)
set(LSB_DISTRIB "unix")
endif(NOT LSB_DISTRIB)
message(STATUS "Packager architecture : ${LSB_DISTRIB}")
#Find DPKG
find_program(DPKG
NAMES dpkg-deb
PATHS "/usr/bin" #Add paths here
)
if ( DPKG )
get_filename_component(DPKG_PATH ${DPKG} ABSOLUTE)
message(STATUS "Packaging deb using ${DPKG_PATH}: OK")
......@@ -84,29 +93,127 @@ if (UNIX AND NOT WIN32)
set(DPKG_FOUND "NO")
endif()
if(DPKG_FOUND)
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
message(STATUS "Install prefix: ${CPACK_PACKAGING_INSTALL_PREFIX}")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
# For Debian-based distribs we want to create DEB packages.
if("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
# make_directory(${CMAKE_BINARY_DIR}/packaging/debian)
# set(GTK_UPDATE_ICON_CACHE "gtk-update-icon-cache -f -t ${THEME_DIRECTORY}")
# configure_file( ${CMAKE_SOURCE_DIR}/cmake/debian/postinst.in ${CMAKE_BINARY_DIR}/packaging/debian/postinst )
# configure_file( ${CMAKE_SOURCE_DIR}/cmake/debian/prerm.in ${CMAKE_BINARY_DIR}/packaging/debian/prerm )
#
# set(CPACK_GENERATOR "DEB")
# set(CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
# set(CPACK_DEBIAN_PACKAGE_SECTION "photos")
# set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "")
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/packaging/debian/postinst;${CMAKE_BINARY_DIR}/packaging/debian/prerm;" )
# We need to alter the architecture names as per distro rules
if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
set(CPACK_PACKAGE_ARCHITECTURE i386)
endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
if("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
set(CPACK_PACKAGE_ARCHITECTURE amd64)
endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
# Set the dependencies based on the distrib version
# Installation path
# Set the install location to "/usr"
set(CAMITK_INSTALL_ROOT "/usr")
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
set(CPACK_SET_DESTDIR TRUE)
#set(CPACK_INSTALLED_DIRECTORIES "${CAMITK_INSTALL_ROOT}/include" "usr/include")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) # Change to your architecture here, there is no such thing as i686 in deb!
# TODO update list of dependencies
# For Ubuntu10.04
if("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.16 ( >= 3.16.0-1 ), libxml2, libvtk5.2-qt4")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
# For Ubuntu10.10
if("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.18, libxml2, libvtk5.4-qt4")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
# Set build type by default as release
set(CMAKE_BUILD_TYPE "Release")
# 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)
# Dependencies depending on the Operating System.
# Ubuntu
if("${LSB_DISTRIB}" MATCHES "Ubuntu11.10")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.20, libxml2, libvtk5.6-qt4 ")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu11.10")
# For Ubuntu11.04
if("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.18, libxml2, libvtk5.4-qt4 ")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
endif()
if("${LSB_DISTRIB}" MATCHES "Ubuntu12.04")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.20, libxml2, libvtk5.8-qt4 ")
endif("${LSB_DISTRIB}" MATCHES "Ubuntu12.04")
# Debian
# if("${LSB_DISTRIB}" MATCHES "Debian5.*")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk2.0-0, libsqlite3-0, libglade2-0, libgegl-0.0-0, libcairo2, libexiv2-5, liblcms1, libjpeg62, libpng12-0, liblensfun0, liblensfun-data")
#
# endif("${LSB_DISTRIB}" MATCHES "Debian5.*")
# if("${LSB_DISTRIB}" MATCHES "Debiantesting")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libgtk2.0-0, libsqlite3-0, libglade2-0, libgegl-0.0-0, libcairo2, libexiv2-5, liblcms1, libjpeg62, libpng12-0, liblensfun0, liblensfun-data")
# endif("${LSB_DISTRIB}" MATCHES "Debiantesting")
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message("WARNING: ${LSB_DISTRIB} not supported yet.\nPlease set deps in cmake/darktable-packaging.cmake before packaging.")
endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
endif("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
# 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" "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)
# set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
# set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
# set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
# set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
# set(CPACK_SET_DESTDIR TRUE)
# #set(CPACK_INSTALLED_DIRECTORIES "${CAMITK_INSTALL_ROOT}/include" "usr/include")
# set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) # Change to your architecture here, there is no such thing as i686 in deb!
# # TODO update list of dependencies
# message(STATUS "Variable LSB_DISTRIB = ${LSB_DISTRIB} ")
# # For Ubuntu10.04
# if("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.16 ( >= 3.16.0-1 ), libxml2, libvtk5.2-qt4")
# endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.04")
# # For Ubuntu10.10
# if("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.18, libxml2, libvtk5.4-qt4")
# endif("${LSB_DISTRIB}" MATCHES "Ubuntu10.10")
# # For Ubuntu11.04
# if("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libinsighttoolkit3.18, libxml2, libvtk5.4-qt4 ")
# endif("${LSB_DISTRIB}" MATCHES "Ubuntu11.04")
# # For Ubuntu11.04
#
# endif()
# -------------
# RPM packages
......
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