Commit 6c04d361 authored by Gabriel Devillers's avatar Gabriel Devillers
Browse files

Packaging on Linux

Packaging works on Linux if build uses -DUSE_SYSTEM_python

Also tested when branding != "VeloView"
parent 4f7bdd40
......@@ -3,7 +3,29 @@ cmake_minimum_required(VERSION 2.8.8)
project(VeloViewSuperBuild)
set (SuperBuild_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
set (SuperBuild_PROJECTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Projects")
set (SuperBuild_BINARY_DIR ${VeloViewSuperBuild_BINARY_DIR})
set (SuperBuild_BINARY_DIR ${VeloViewSuperBuild_BINARY_DIR}) # required to do FindPackage(ParaView) inside Veloview's CMakeLists
macro (superbuild_setup_variables)
include(SuperbuildVersionMacros)
# if (paraview_SOURCE_SELECTION STREQUAL "git")
# # Assuming master; just use the latest version, but let the user set their
# # own version in case it is actually a branch from some other version.
# set(PARAVIEW_VERSION_DEFAULT "5.5.0"
# CACHE STRING "The default version of ParaView to use if it cannot be detected")
# mark_as_advanced(PARAVIEW_VERSION_DEFAULT)
# set(paraview_default_version "${PARAVIEW_VERSION_DEFAULT}")
# elseif (paraview_SOURCE_SELECTION STREQUAL "source")
# # If it is a git repo, we'll get it that way, otherwise we will look at the
# # `version.txt` in the checkout.
# set(paraview_default_version "")
# else ()
# # The selection is the version number; use it.
# set(paraview_default_version "${paraview_SOURCE_SELECTION}")
# endif()
# superbuild_set_version_variables(paraview "${paraview_default_version}" "paraview-version.cmake" "version.txt")
# set(paraview_version "${paraview_version_major}.${paraview_version_minor}")
set(paraview_version "5.4")
endmacro ()
#------------------------------------------------------------------------------
# Set a default build type if none was specified
......@@ -55,7 +77,6 @@ function (superbuild_find_projects var)
pythonqt
qt5
veloview
veloview.bundle
zlib
)
......@@ -92,6 +113,49 @@ if (WIN32)
endif()
endif()
function (superbuild_add_packaging)
if (WIN32)
set(generators
ZIP
NSIS)
elseif (APPLE)
set(generators
DragNDrop)
else ()
set(generators
TGZ
TXZ)
endif ()
list(GET generators 0 default_generator)
if (USE_SYSTEM_qt5)
list(APPEND superbuild_export_variables
Qt5_DIR)
endif ()
# pass some variables that are required for packaging step:
list(APPEND superbuild_export_variables
PARAVIEW_VERSION
package_suffix
)
set(default_package veloview)
foreach (generator IN LISTS generators)
superbuild_add_extra_package_test(veloview "${generator}"
LABELS "VeloView" # does not have to be ${SOFTWARE_NAME} I think
TIMEOUT 6400)
endforeach ()
if (default_package)
superbuild_enable_install_target("${default_package}/${default_generator}")
endif ()
endfunction ()
function (superbuild_add_tests)
# TODO: add existing tests
# add_subdirectory("${CMAKE_SOURCE_DIR}/tests" "${CMAKE_BINARY_DIR}/tests")
endfunction ()
# skiped module as defined in paraview superbuild.
# One difference: pythonQt needs Multimedia so we don't skip it.
set(qt5_skip_modules
......
#SET(CPACK_GENERATOR "DEB")
#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "David Oroshnik <doroshnik@velodyne.com>") #required
#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libqt4-core (>= 4.8.4), libqt4-core (>= 4.8.4), python (>= 2.7)")
#SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# include(paraview-version)
include(veloview.bundle.common)
include(CPack)
# install all ParaView's shared libraries.
install(DIRECTORY "${install_location}/lib/paraview-${PARAVIEW_VERSION}"
set(veloview_component "${SOFTWARE_NAME}")
include(veloview.bundle.unix)
install(DIRECTORY "${superbuild_install_location}/lib/paraview-${PARAVIEW_VERSION}"
DESTINATION "lib"
USE_SOURCE_PERMISSIONS
COMPONENT superbuild)
# install all libraries
install(DIRECTORY "${install_location}/lib/veloview-${VV_VERSION}"
install(DIRECTORY "${superbuild_install_location}/lib/veloview-${VV_VERSION}"
DESTINATION "lib"
USE_SOURCE_PERMISSIONS
COMPONENT superbuild)
# Sensor calibration files
file(GLOB shared_files "${install_location}/share/*.xml")
file(GLOB shared_files "${superbuild_install_location}/share/*.xml")
install(FILES ${shared_files}
DESTINATION "share"
COMPONENT superbuild
)
unset(shared_files)
# Workaround to ship required .so in the .sh installer
file(GLOB lib_files_so
"${install_location}/lib/libPythonQt.so"
"${install_location}/lib/libpcap*.so*"
"${install_location}/lib/liblas*.so*"
"${install_location}/lib/libboost*.so*" # could be replqce by a package dependency
"${install_location}/lib/libQt*.so*" # could be replqce by a package dependency
"${install_location}/lib/libfreetype*.so*"
"${install_location}/lib/libfontconfig*.so*"
"${superbuild_install_location}/lib/libPythonQt.so"
"${superbuild_install_location}/lib/libpcap*.so*"
"${superbuild_install_location}/lib/liblas*.so*"
"${superbuild_install_location}/lib/libboost*.so*" # could be replaced by a package dependency
"${superbuild_install_location}/lib/libQt*.so*" # could be replaced by a package dependency
"${superbuild_install_location}/lib/libfreetype*.so*"
"${superbuild_install_location}/lib/libfontconfig*.so*"
)
install(DIRECTORY
# install all qt plugins (including sqllite).
# FIXME: we can reconfigure Qt to be built with inbuilt sqllite support to
# avoid the need for plugins.
"${superbuild_install_location}/plugins/"
DESTINATION "lib/veloview-${VV_VERSION}"
COMPONENT superbuild
PATTERN "*.a" EXCLUDE
PATTERN "veloview-${VV_VERSION}" EXCLUDE
PATTERN "fontconfig" EXCLUDE
PATTERN "*.jar" EXCLUDE
PATTERN "*.debug.*" EXCLUDE
PATTERN "libboost*" EXCLUDE)
install(FILES ${lib_files_so}
DESTINATION "lib/veloview-${VV_VERSION}"
COMPONENT superbuild)
unset(lib_files_so)
if (qt_ENABLED AND NOT USE_SYSTEM_qt)
install(DIRECTORY
# install all qt plugins (including sqllite).
# FIXME: we can reconfigure Qt to be built with inbuilt sqllite support to
# avoid the need for plugins.
"${install_location}/plugins/"
DESTINATION "lib/veloview-${VV_VERSION}"
COMPONENT superbuild
PATTERN "*.a" EXCLUDE
PATTERN "veloview-${VV_VERSION}" EXCLUDE
PATTERN "fontconfig" EXCLUDE
PATTERN "*.jar" EXCLUDE
PATTERN "*.debug.*" EXCLUDE
PATTERN "libboost*" EXCLUDE)
endif()
# install executables
foreach(executable ${SOFTWARE_NAME})
install(PROGRAMS "${install_location}/bin/${executable}"
DESTINATION "bin"
COMPONENT superbuild)
endforeach()
set(library_paths
"${superbuild_install_location}/lib")
if (Qt5_DIR)
list(APPEND library_paths
"${Qt5_DIR}/../..")
endif ()
set(include_regexes)
set(exclude_regexes)
foreach (executable IN LISTS veloview_executables)
superbuild_unix_install_program_fwd("${executable}"
"bin"
SEARCH_DIRECTORIES "${library_paths}"
INCLUDE_REGEXES ${include_regexes}
EXCLUDE_REGEXES ${exclude_regexes})
endforeach ()
# this was present in ParaView's paraview.bundle.unix.cmake,
# delete when it is certain that this is not needed for VeloView:
if (python_enabled)
include(python.functions)
superbuild_install_superbuild_python(
LIBSUFFIX "/python2.7")
superbuild_unix_install_python(
LIBDIR "lib"
MODULES paraview
vtk
vtkmodules
${python_modules}
INCLUDE_REGEXES ${include_regexes}
EXCLUDE_REGEXES ${exclude_regexes}
MODULE_DIRECTORIES "${superbuild_install_location}/lib/python2.7/site-packages"
LOADER_PATHS "${library_paths}")
# if (matplotlib_built_by_superbuild)
# install(
# DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
# DESTINATION "lib/python2.7/site-packages/matplotlib/mpl-data"
# COMPONENT superbuild)
# endif ()
endif ()
if (qt5_enabled)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "")
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
DESTINATION "lib"
COMPONENT superbuild)
endif ()
# this was present in ParaView's paraview.bundle.unix.cmake,
# delete when it is certain that this is not needed for VeloView:
message(STATUS "TOP: qt5_plugin_paths is: ${qt5_plugin_path}")
# foreach (qt5_plugin_path IN LISTS qt5_plugin_paths)
# get_filename_component(qt5_plugin_group "${qt5_plugin_path}" DIRECTORY)
# get_filename_component(qt5_plugin_group "${qt5_plugin_group}" NAME)
#
# superbuild_unix_install_plugin("${qt5_plugin_path}"
# "lib"
# "lib/plugins/${qt5_plugin_group}/"
# LOADER_PATHS "${library_paths}"
# INCLUDE_REGEXES ${include_regexes}
# EXCLUDE_REGEXES ${exclude_regexes})
# endforeach ()
# Enable CPack packaging.
set(VeloViewSuperBuild_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
include(${VeloViewSuperBuild_SOURCE_DIR}/../SoftwareInformation/branding.cmake)
# Include CMake scripts for geting the version from Git
include(Git)
include(ParaViewDetermineVersion)
......@@ -18,15 +22,11 @@ if(NOT (version_txt STREQUAL VV_VERSION_FULL))
message(STATUS "Git version (${VV_VERSION_FULL}) differs from version in file (${version_txt}) at " ${VV_VERSION_FILE})
endif()
# Sets GD_YEAR, GD_MONTH, GD_DAY
include(${VeloViewSuperBuild_SOURCE_DIR}/Projects/getdate.cmake)
GET_DATE()
set(PACKAGE_TIMESTAMP "${GD_YEAR}${GD_MONTH}${GD_DAY}")
# Enable CPack packaging.
include(${VeloViewSuperBuild_SOURCE_DIR}/../SoftwareInformation/branding.cmake)
set(CPACK_COMPONENT_VELOVIEW_DISPLAY_NAME ${SOFTWARE_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${VV_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VV_VERSION_MINOR})
......@@ -36,8 +36,6 @@ if (NOT VV_VERSION_IS_RELEASE)
else()
endif()
set(CPACK_RESOURCE_FILE_LICENSE "${VeloViewSuperBuild_SOURCE_DIR}/LICENSE")
if (NOT VV_VERSION_IS_RELEASE)
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${VV_VERSION_FULL}-${PACKAGE_TIMESTAMP}-${package_suffix}")
......@@ -46,3 +44,9 @@ else()
"${CPACK_PACKAGE_NAME}-${VV_VERSION_FULL}-${package_suffix}")
endif()
message(STATUS "Bundled package name will be: ${CPACK_PACKAGE_FILE_NAME}" )
# Set the license file.
set(CPACK_RESOURCE_FILE_LICENSE "${VeloViewSuperBuild_SOURCE_DIR}/LICENSE")
set(veloview_executables
${SOFTWARE_NAME})
Markdown is supported
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