cmake_minimum_required(VERSION 2.4)

if(COMMAND cmake_policy)
  cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)


PROJECT(FSLVIEW)

SET(CMAKE_MODULE_PATH ${FSLVIEW_SOURCE_DIR}/cmake)
SET(CMAKE_BUILD_TYPE Debug)
SET(LIBRARY_OUTPUT_PATH ${FSLVIEW_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${FSLVIEW_BINARY_DIR}/bin)

INCLUDE_DIRECTORIES(${FSLVIEW_SOURCE_DIR}/fsl)
INCLUDE_DIRECTORIES(${FSLVIEW_SOURCE_DIR}/fsl/newmat)
INCLUDE_DIRECTORIES(${FSLVIEW_SOURCE_DIR}/fsl/niftiio)
INCLUDE_DIRECTORIES(${FSLVIEW_SOURCE_DIR}/fsl/znzlib)
INCLUDE_DIRECTORIES(${FSLVIEW_SOURCE_DIR}/src)

ENABLE_TESTING()

SUBDIRS(fsl src doc/fslview)


set(CPACK_PACKAGE_NAME "fslview")

# CPack version numbers for release tarball name.
set(CPACK_PACKAGE_VERSION_MAJOR 4)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 1)
set(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION ${VERSION})

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FSLView - FSL visualisation tool")
set(CPACK_PACKAGE_VENDOR "Oxford University - FMRIB Software Library")
set(CPACK_PACKAGE_CONTACT "Dave Flitney <flitney@fmrib.ox.ac.uk>")
#set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)

set(CPACK_SOURCE_PACKAGE_FILE_NAME "fslview-${VERSION}" CACHE INTERNAL "tarball basename")
set(CPACK_SOURCE_GENERATOR TGZ)

set(CPACK_GENERATOR DEB RPM)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqwt5-qt4 (>=5.2.2) libvtk5.8-qt4 (>=5.8.0)")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Matthew Webster <mwebster@fmrib.ox.ac.uk>")

INCLUDE(CPack)
