From d69644e62817d13de0c295ff4ac3032d3241d59b Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 20 Apr 2014 12:46:34 +0000 Subject: [PATCH] Made latest man page generation enhancements Mac friendly. Non-Debug build on *nix platforms now require a2x, it is optional for other build configurations. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4050 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- CMakeLists.txt | 5 ++++- debian/CMakeLists.txt | 2 +- manpages/CMakeLists.txt | 22 ++++++++++------------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7acd62d3d..6f5460f9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -375,6 +375,7 @@ if (APPLE) set (WSJT_QT_CONF_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources) set (WSJT_SHARE_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources) set (WSJT_DOC_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources) + set (WSJT_MANPAGE_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/Resources) set (WSJT_BIN_DESTINATION ${CMAKE_PROJECT_NAME}.app/Contents/MacOS) endif (APPLE) @@ -623,7 +624,9 @@ qt5_use_modules (wsjtx Widgets OpenGL Network Multimedia) if (UNIX) add_subdirectory (manpages) - add_subdirectory (debian) + if (NOT APPLE) + add_subdirectory (debian) + endif (NOT APPLE) add_dependencies (wsjtx manpages debian) endif (UNIX) diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index ceccb7664..b1bb7a425 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -19,7 +19,7 @@ configure_file ( @ONLY) add_custom_target (debian - COMMAND ${GZIP_EXECUTABLE} --keep --best --force changelog + COMMAND ${GZIP_EXECUTABLE} -9 --force changelog DEPENDS changelog.in WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Compressing Debian changelog" diff --git a/manpages/CMakeLists.txt b/manpages/CMakeLists.txt index 3e45208fd..1b0bf0e6c 100644 --- a/manpages/CMakeLists.txt +++ b/manpages/CMakeLists.txt @@ -4,16 +4,14 @@ set (ASCIIDOC_MANS find_program (A2X_EXECUTABLE NAMES a2x a2x.py) if (NOT A2X_EXECUTABLE) - message (SEND_ERROR "Failed to find a2x.") + if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + message (SEND_ERROR "Failed to find a2x which is required for release builds on *nix platforms.") + else (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + message (WARNING "Failed to find a2x skipping manpage generation.") + endif (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") endif () find_program (GZIP_EXECUTABLE NAMES gzip) -if (NOT GZIP_EXECUTABLE) - message (SEND_ERROR "Failed to find gzip.") -endif () find_program (SED_EXECUTABLE NAMES sed) -if (NOT SED_EXECUTABLE) - message (SEND_ERROR "Failed to find sed.") -endif () set (XSLTPROC_OPTS "-param man.endnotes.list.enabled 0 -param man.endnotes.are.numbered 0" @@ -26,7 +24,7 @@ set (A2X_OPTS ) set (MANPAGES) -if (A2X_EXECUTABLE AND GZIP_EXECUTABLE) +if (A2X_EXECUTABLE AND GZIP_EXECUTABLE AND SED_EXECUTABLE) file (MAKE_DIRECTORY man) foreach (f IN LISTS ASCIIDOC_MANS) get_filename_component (d "${f}" PATH) @@ -41,9 +39,9 @@ if (A2X_EXECUTABLE AND GZIP_EXECUTABLE) add_custom_command (OUTPUT "${o}.gz" COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${d}" COMMAND ${A2X_EXECUTABLE} ARGS ${A2X_OPTS} -D "${d}" "${f}" - COMMAND ${GZIP_EXECUTABLE} ARGS -r --force --best "${o}" - COMMAND ${SED_EXECUTABLE} ARGS --in-place "s@.so @.so man${section}/@" "${d}/*.${section}" - COMMAND ${GZIP_EXECUTABLE} ARGS -r --force --best "${d}/*.${section}" + COMMAND ${GZIP_EXECUTABLE} ARGS -f9 "${o}" + COMMAND ${SED_EXECUTABLE} ARGS -e "'s@.so @&man${section}/@'" -i "''" "${d}/*.${section}" + COMMAND ${GZIP_EXECUTABLE} ARGS -f9 "${d}/*.${section}" DEPENDS "${f}" COMMENT "Generating ${o}.gz" ) @@ -54,6 +52,6 @@ if (A2X_EXECUTABLE AND GZIP_EXECUTABLE) DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/man DESTINATION ${WSJT_MANPAGE_DESTINATION} ) -endif (A2X_EXECUTABLE AND GZIP_EXECUTABLE) +endif (A2X_EXECUTABLE AND GZIP_EXECUTABLE AND SED_EXECUTABLE) add_custom_target (manpages DEPENDS ${MANPAGES})