2020-01-21 23:15:15 +01:00
|
|
|
find_program(LSB_RELEASE_EXEC lsb_release)
|
|
|
|
find_program(DPKG_BUILDPACKAGE dpkg-buildpackage)
|
|
|
|
|
|
|
|
if (LSB_RELEASE_EXEC AND DPKG_BUILDPACKAGE)
|
2020-01-21 23:53:28 +01:00
|
|
|
execute_process(COMMAND env LC_ALL=C date "+%a, %-d %b %Y %H:%M:%S %z" OUTPUT_VARIABLE DEB_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
2020-01-21 23:15:15 +01:00
|
|
|
execute_process(COMMAND /bin/sh "-c" "${LSB_RELEASE_EXEC} -cs"
|
|
|
|
OUTPUT_VARIABLE DEB_CODENAME
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
2020-01-21 23:53:28 +01:00
|
|
|
|
2020-01-21 23:15:15 +01:00
|
|
|
if (DEB_CODENAME)
|
2020-01-21 23:53:28 +01:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/debian/changelog.in ${CMAKE_SOURCE_DIR}/debian/changelog)
|
2020-01-21 23:15:15 +01:00
|
|
|
add_custom_target(deb
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
COMMAND ${DPKG_BUILDPACKAGE} -b -d -uc -us
|
|
|
|
)
|
|
|
|
endif()
|
2020-01-21 23:53:28 +01:00
|
|
|
|
2020-01-21 23:15:15 +01:00
|
|
|
endif()
|