diff options
author | Gaute Hope <eg@gaute.vetsj.com> | 2018-08-30 10:54:31 +0200 |
---|---|---|
committer | Gaute Hope <eg@gaute.vetsj.com> | 2018-08-30 10:54:31 +0200 |
commit | 20b91716828af6dc2335e334ca4742495acd9526 (patch) | |
tree | e5b3c2ab65002427aa7f6978e5b4fb34737215e6 | |
parent | e80ead9bf07e7d539670b04f6f8690763ed4de3a (diff) |
cmake, man: add option to disable manpage generation -DDISABLE_DOCS=ON
-rw-r--r-- | CMakeLists.txt | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 46b8ec2..a2d707f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,10 +60,11 @@ endif() ## # cmake -D...=ON|OFF command line feature switches and their default values # -option (DISABLE_TERMINAL "Disable embedded terminal (default = enabled)" OFF) -option (DISABLE_EMBEDDED_EDITOR "Disable embedded editor (default = enabled)" OFF) -option (DISABLE_PLUGINS "Disable plugins (default = enabled)" OFF) -option (ENABLE_PROFILING "Enable profiling (default = disabled)" OFF) +option (DISABLE_TERMINAL "Disable embedded terminal (default = enabled)" OFF) +option (DISABLE_EMBEDDED_EDITOR "Disable embedded editor (default = enabled)" OFF) +option (DISABLE_PLUGINS "Disable plugins (default = enabled)" OFF) +option (DISABLE_DOCS "Disable generating docs (manpage) (default = enabled)" OFF) +option (ENABLE_PROFILING "Enable profiling (default = disabled)" OFF) option (DISABLE_LIBSASS "Disable libsass, requires a sassc compiler (default = enabled)" OFF) option (DEBUG_WEBKIT "Turn on extra debug options for WebKit (default = disabled)" OFF) @@ -395,25 +396,29 @@ if(DISABLE_LIBSASS) endif() ## Build man pages -find_program (SCDOC scdoc) # preferred -find_program (RONN ronn) - -if (SCDOC) - add_custom_command ( - TARGET astroid - COMMAND ${SCDOC} < ${CMAKE_SOURCE_DIR}/doc/astroid.1.scd | gzip > ${CMAKE_BINARY_DIR}/astroid.1.gz - COMMENT "Generating man page (scdoc)") -else () - if (RONN) - message (WARNING "Falling back to 'ronn' for man page generation.") - add_custom_command ( +if (NOT DISABLE_DOCS) + find_program (SCDOC scdoc) # preferred + find_program (RONN ronn) + + if (SCDOC) + add_custom_command ( TARGET astroid - COMMAND ${RONN} -rp ${CMAKE_SOURCE_DIR}/doc/astroid.1.scd | gzip > ${CMAKE_BINARY_DIR}/astroid.1.gz - COMMENT "Generating man page (ronn)") + COMMAND ${SCDOC} < ${CMAKE_SOURCE_DIR}/doc/astroid.1.scd | gzip > ${CMAKE_BINARY_DIR}/astroid.1.gz + COMMENT "Generating man page (scdoc)") else () - message (FATAL_ERROR "Neither 'scdoc' nor 'ronn' installed. One is required for man page generation") + if (RONN) + message (WARNING "Falling back to 'ronn' for man page generation.") + add_custom_command ( + TARGET astroid + COMMAND ${RONN} -rp ${CMAKE_SOURCE_DIR}/doc/astroid.1.scd | gzip > ${CMAKE_BINARY_DIR}/astroid.1.gz + COMMENT "Generating man page (ronn)") + else () + message (FATAL_ERROR "Neither 'scdoc' nor 'ronn' installed. One is required for man page generation.") + endif() endif() -endif() +else () + message (STATUS "Documentation generation (manpage) disabled.") +endif () ## # embedded editor @@ -528,9 +533,11 @@ install ( TARGETS tvextension ) # Install man page -install ( FILES ${CMAKE_BINARY_DIR}/astroid.1.gz - DESTINATION share/man/man1 - ) +if (NOT DISABLE_DOCS) + install ( FILES ${CMAKE_BINARY_DIR}/astroid.1.gz + DESTINATION share/man/man1 + ) +endif () # icons are installed in three locations install (DIRECTORY ui/icons |