mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 08:51:19 -05:00
0e214efb9c
Using the CMake module GNUInstallDirs to set up standard locations which allows better customisation for packagers building for various distributions. The change does change some internal package file paths and will leave some files in old locations in Windows installations. Running uninstall is probably wise on Windows before installing this new package layout if future clean uninstalls are desired. Linux and other *nix package maintainers can use the CMake variables CMAKE_INSTALL_xxx to vary the install paths of various components. See the CMake GNUInstallDirs module documentation for more details. An example might be for Slackware where package documents are expected to be installed into <install-prefix>/doc/<package-name>-<package-version>/ whereas the GNU default is to install them into <install-prefix>/share/doc/<package-name>/. To achieve this set the CMake variable CMAKE_INSTALL_DOCDIR as follows when configuring: cmake -D CMAKE_INSTALL_DOCDIR:PATH=doc/wsjtx-1.7.1 -D CMAKE_INSTALL_PREFIX= ... git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7623 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
40 lines
1.2 KiB
CMake
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.Debian)
|
|
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
|
|
)
|