From b6caf8f7a5bcc1b66c532de672f60c61634f8d10 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 7 Mar 2015 22:08:39 +0000 Subject: [PATCH 1/4] Create man page as part of cmake build --- CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7726646..c1eee90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,45 @@ if (BUILD_SAMPLE_CODE) # no INSTALL of this 'local' sample endif () +#========================================================== +# Create man pages +#========================================================== +if (UNIX) + find_program( XSLTPROC_FOUND xsltproc ) + if (XSLTPROC_FOUND) + ## NOTE: man name must match exe ie currently `tidy5.`` not `tidy.1` + message("*** Generating man ***") + set(TIDY1XSL ../documentation/tidy1.xsl) + set(TIDYHELP ${CMAKE_BINARY_DIR}/tidy-help.xml) + add_custom_target(man ALL) + + # run built EXE to generate xml output + add_custom_command( + OUTPUT ${TIDYHELP} + COMMAND ${CMAKE_BINARY_DIR}/tidy5 -xml-help > ${TIDYHELP} + COMMENT "Generate ${TIDYHELP}" + VERBATIM + ) + # repeated for tidy-config.xml + # run xsltproc to generate the install files.. + add_custom_command( + TARGET man + SOURCE ${TIDYHELP} + COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/tidy5.1 + OUTPUTS ${CMAKE_BINARY_DIR}/tidy5.1 + VERBATIM + ) + add_custom_command( + TARGET man + SOURCE man + DEPENDS ${CMAKE_BINARY_DIR}/tidy5.1 + ) + # repeated for quickref.html - may need different targets... + install(FILES ${CMAKE_BINARY_DIR}/tidy5.1 DESTINATION local/man/man1) + # add the quickref.html install + endif () +endif () + ########################################################## ### Create MSI,EXE, DMG, DEB/RPM @@ -192,6 +231,8 @@ else () set(CPACK_SOURCE_GENERATOR "TGZ") endif () +set(CPACK_PACKAGE_NAME "Tidy5") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Tidy5 - HTML syntax checker") set(CPACK_PACKAGE_VENDOR "HTML Tidy Advocacy Community Group") set(CPACK_PACKAGE_CONTACT "maintainer@htacg.org") From b39a953f69f74da60b34cf5185603f94a7bb62bd Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 7 Mar 2015 22:11:51 +0000 Subject: [PATCH 2/4] Add note re using manpath --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1eee90..b160902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,6 +176,7 @@ if (UNIX) find_program( XSLTPROC_FOUND xsltproc ) if (XSLTPROC_FOUND) ## NOTE: man name must match exe ie currently `tidy5.`` not `tidy.1` + ## also could use `manpath` command output to determine target install path message("*** Generating man ***") set(TIDY1XSL ../documentation/tidy1.xsl) set(TIDYHELP ${CMAKE_BINARY_DIR}/tidy-help.xml) From 3f8a95601ef8a331f053f00616e4ec190ab1cfc1 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 7 Mar 2015 22:27:02 +0000 Subject: [PATCH 3/4] Make man filename into a cmake variable --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b160902..8b56952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,9 +175,10 @@ endif () if (UNIX) find_program( XSLTPROC_FOUND xsltproc ) if (XSLTPROC_FOUND) - ## NOTE: man name must match exe ie currently `tidy5.`` not `tidy.1` + ## NOTE: man name must match exe ie currently `tidy5.1` not `tidy.1` ## also could use `manpath` command output to determine target install path message("*** Generating man ***") + set(TIDY1_MANFILE tidy5.1) set(TIDY1XSL ../documentation/tidy1.xsl) set(TIDYHELP ${CMAKE_BINARY_DIR}/tidy-help.xml) add_custom_target(man ALL) @@ -194,17 +195,17 @@ if (UNIX) add_custom_command( TARGET man SOURCE ${TIDYHELP} - COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/tidy5.1 - OUTPUTS ${CMAKE_BINARY_DIR}/tidy5.1 + COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} + OUTPUTS ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} VERBATIM ) add_custom_command( TARGET man SOURCE man - DEPENDS ${CMAKE_BINARY_DIR}/tidy5.1 + DEPENDS ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} ) # repeated for quickref.html - may need different targets... - install(FILES ${CMAKE_BINARY_DIR}/tidy5.1 DESTINATION local/man/man1) + install(FILES ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} DESTINATION local/man/man1) # add the quickref.html install endif () endif () From c013fa97d9fd7ba4257eda6c967c7b1cd9a453d8 Mon Sep 17 00:00:00 2001 From: Pedro Date: Sat, 7 Mar 2015 22:28:58 +0000 Subject: [PATCH 4/4] Make man filename into a cmake variable --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b56952..bbdae32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,7 +178,7 @@ if (UNIX) ## NOTE: man name must match exe ie currently `tidy5.1` not `tidy.1` ## also could use `manpath` command output to determine target install path message("*** Generating man ***") - set(TIDY1_MANFILE tidy5.1) + set(TIDY_MANFILE tidy5.1) set(TIDY1XSL ../documentation/tidy1.xsl) set(TIDYHELP ${CMAKE_BINARY_DIR}/tidy-help.xml) add_custom_target(man ALL) @@ -195,17 +195,17 @@ if (UNIX) add_custom_command( TARGET man SOURCE ${TIDYHELP} - COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} - OUTPUTS ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} + COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_BINARY_DIR}/${TIDY_MANFILE} + OUTPUTS ${CMAKE_BINARY_DIR}/${TIDY_MANFILE} VERBATIM ) add_custom_command( TARGET man SOURCE man - DEPENDS ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} + DEPENDS ${CMAKE_BINARY_DIR}/${TIDY_MANFILE} ) # repeated for quickref.html - may need different targets... - install(FILES ${CMAKE_BINARY_DIR}/${TIDY1_MANFILE} DESTINATION local/man/man1) + install(FILES ${CMAKE_BINARY_DIR}/${TIDY_MANFILE} DESTINATION local/man/man1) # add the quickref.html install endif () endif ()