File: CMakeLists.txt

package info (click to toggle)
wsclean 3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,968 kB
  • sloc: cpp: 85,742; python: 3,526; sh: 245; makefile: 21
file content (80 lines) | stat: -rw-r--r-- 2,747 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later

# Ensure that we use /usr as install prefix when packaging.
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")

# We use git to determine the version string from the latest tag.
find_package(Git)
if(Git_FOUND)
  execute_process(
    COMMAND bash -c "${GIT_EXECUTABLE} describe --tags --dirty"
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE VERSION_STRING
    OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
  # Strip leading non-numeric characters, like "v"
  string(REGEX REPLACE "^[^[0-9]]*" "" VERSION_STRING ${VERSION_STRING})
endif()
if(NOT VERSION_STRING)
  set(VERSION_STRING "0.0")
  message(WARNING "[CPack] Could not find tag to create version string, "
                  "using ${VERSION_STRING} instead.")
endif()

# Determine target CPU
include(${CMAKE_CURRENT_SOURCE_DIR}/DetermineTargetCPU.cmake)

# Set package name: encode target CPU, if defined, in package name.
if(DEFINED IDENTIFIED_TARGET_CPU)
  set(CPACK_PACKAGE_NAME "wsclean-${IDENTIFIED_TARGET_CPU}")
else()
  set(CPACK_PACKAGE_NAME "wsclean")
endif()

set(CPACK_PACKAGE_VENDOR "ASTRON")
set(CPACK_PACKAGE_VERSION "${VERSION_STRING}")

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "WSClean (w-stacking clean)")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://gitlab.com/aroffringa/wsclean")

set(CPACK_GENERATOR "DEB")
set(CPACK_SOURCE_GENERATOR "TGZ")

set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
if(DEFINED IDENTIFIED_TARGET_CPU)
  set(CPACK_DEBIAN_PACKAGE_DEPENDS
      "everybeam (>=0.1), idg-${IDENTIFIED_TARGET_CPU}-api (>=0.8)")
else()
  set(CPACK_DEBIAN_PACKAGE_DEPENDS "everybeam (>=0.1), idg-api (>=0.8)")
endif()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION
    "WSClean (w-stacking clean) is a fast generic widefield imager.
 It implements several gridding algorithms and offers fully-automated
 multi-scale multi-frequency deconvolution.
 Manual: https://wsclean.readthedocs.io/")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "deb-packages@astron.nl")
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

# Determine list of conflicting package names
if(DEFINED IDENTIFIED_TARGET_CPU)
  set(_conflicts wsclean)
else()
  set(_conflicts)
endif()
foreach(_cpu ${KNOWN_TARGET_CPUS})
  if(NOT "${_cpu}" STREQUAL "${IDENTIFIED_TARGET_CPU}")
    if("${_conflicts}" STREQUAL "")
      set(_conflicts "wsclean-${_cpu}")
    else()
      set(_conflicts "${_conflicts}, wsclean-${_cpu}")
    endif()
  endif()
endforeach()
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "${_conflicts}")

include(CPack)

message(STATUS "Package name: ${CPACK_PACKAGE_NAME}")
message(STATUS "Package version: ${CPACK_PACKAGE_VERSION}")