WSJT-X/debian/CMakeLists.txt
Bill Somerville 1995d762bb
Add Version Info resources to Windows executables where needed.
Version information  and more  in the  Windows resources  for main
    applications, installer and un-installer.

    Update  CMake   policies  for  new  project()   command,  and  DEB
    dependency changes

    Support  older  libgfortran  packages,  and  other  Linux  package
    dependencies.

    Use new project description file in Debian packaging.

    Linux packaging dependency adjustments  for Debian style packages,
    including  a machine  readable  Debian  copyright format,  project
    description in separate file for  CPack compatibility, and use for
    DEB packaging.

    Configure check for need to link libm Standard C Math Library.

    CMake compatibility for <3.17.
2020-10-10 13:58:53 +01:00

40 lines
1.2 KiB
CMake

find_program (GZIP_EXECUTABLE NAMES gzip)
string (TIMESTAMP ts "%w, %d [%m] %Y %H:%M:%S +0000" UTC)
set (__days Sun Mon Tue Wed Thu Fri Sat)
string (SUBSTRING ${ts} 0 1 __index)
list (GET __days ${__index} __day)
string (REPLACE "${__index}," "${__day}," ts ${ts})
set (__months Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
string (SUBSTRING ${ts} 9 2 __month_index)
math (EXPR __index "${__month_index} - 1")
list (GET __months "${__index}" __month)
string (REPLACE "[${__month_index}]" "${__month}" ts ${ts})
set (deb_changelog changelog)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/${deb_changelog}.in"
"${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}"
@ONLY)
add_custom_target (debian
COMMAND ${GZIP_EXECUTABLE} -cf9 ${deb_changelog} > ${deb_changelog}.gz
DEPENDS ${deb_changelog}.in
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Compressing Debian changelog"
)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/copyright.in"
"${CMAKE_CURRENT_BINARY_DIR}/copyright"
@ONLY)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/${deb_changelog}.gz
${CMAKE_CURRENT_BINARY_DIR}/copyright
DESTINATION ${CMAKE_INSTALL_DOCDIR}
#COMPONENT Debian
)