veloview.bundle.common.cmake 1.98 KB
Newer Older
1
2
3
4
# Include CMake scripts for geting the version from Git
include(Git)
include(ParaViewDetermineVersion)
# Sets VV_VERSION_{MAJOR,MINOR,PATCH} for git
5
6
set(VV_VERSION_FILE ${VeloViewSuperBuild_SOURCE_DIR}/../version.txt)
file(STRINGS "${VV_VERSION_FILE}" version_txt)
7
8
extract_version_components("${version_txt}" "VV")
determine_version(${VeloViewSuperBuild_SOURCE_DIR} ${GIT_EXECUTABLE} "VV")
9
10
11
12
13
14
15
16
17
18
19
20
# Update the hard-coded version
extract_version_components("${version_txt}" "VV_file")
if((version_txt VERSION_LESS VV_VERSION_FULL)
   OR (version_txt VERSION_EQUAL VV_VERSION_FULL
       AND (VV_file_VERSION_PATCH_EXTRA STRLESS VV_VERSION_PATCH_EXTRA)))
  message(STATUS "Outdated version file updated from ${version_txt} to ${VV_VERSION_FULL} in " ${VV_VERSION_FILE})
  file(WRITE "${VV_VERSION_FILE}" "${VV_VERSION_FULL}")
endif()
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()

21

22
23
24
# Sets GD_YEAR, GD_MONTH, GD_DAY
include(${VeloViewSuperBuild_SOURCE_DIR}/Projects/getdate.cmake)
GET_DATE()
Bastien Jacquet's avatar
Bastien Jacquet committed
25
set(PACKAGE_TIMESTAMP "${GD_YEAR}${GD_MONTH}${GD_DAY}")
26

27
28
29
30
# Enable CPack packaging.
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VeloView")
set(CPACK_PACKAGE_NAME "VeloView")
set(CPACK_PACKAGE_VENDOR "Velodyne Lidar")
31
32
set(CPACK_PACKAGE_VERSION_MAJOR ${VV_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VV_VERSION_MINOR})
33
set(CPACK_PACKAGE_VERSION_PATCH ${VV_VERSION_PATCH})
Bastien Jacquet's avatar
Bastien Jacquet committed
34
if (NOT VV_VERSION_IS_RELEASE)
35
  set(CPACK_PACKAGE_VERSION_PATCH ${VV_VERSION_PATCH}-${VV_VERSION_PATCH_EXTRA})
36
37
38
else()
endif()

39
set(CPACK_RESOURCE_FILE_LICENSE "${VeloViewSuperBuild_SOURCE_DIR}/LICENSE")
40

Bastien Jacquet's avatar
Bastien Jacquet committed
41
42
43
44
45
46
47
if (NOT VV_VERSION_IS_RELEASE)
  set(CPACK_PACKAGE_FILE_NAME
      "${CPACK_PACKAGE_NAME}-${VV_VERSION_FULL}-${PACKAGE_TIMESTAMP}-${package_suffix}")
else()
  set(CPACK_PACKAGE_FILE_NAME
      "${CPACK_PACKAGE_NAME}-${VV_VERSION_FULL}-${package_suffix}")
endif()
48
message(STATUS "Bundled package name will be: ${CPACK_PACKAGE_FILE_NAME}" )