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
This commit is contained in:
Bill Somerville 2014-04-20 12:46:34 +00:00
parent 0e6ca32fe2
commit d69644e628
3 changed files with 15 additions and 14 deletions

View File

@ -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)
if (NOT APPLE)
add_subdirectory (debian)
endif (NOT APPLE)
add_dependencies (wsjtx manpages debian)
endif (UNIX)

View File

@ -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"

View File

@ -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})