From fdb54ce7e7c4e8efbbcfd93c417ff71e70023ddc Mon Sep 17 00:00:00 2001 From: Jonathan Roelofs Date: Wed, 5 Apr 2017 14:49:46 +0000 Subject: [PATCH] Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages This is a re-work of r297516, which was reverted in r297545. https://reviews.llvm.org/D30906 llvm-svn: 299547 --- cmake/modules/AddSphinxTarget.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake index 3456b536e80..cfc7f38e9e7 100644 --- a/cmake/modules/AddSphinxTarget.cmake +++ b/cmake/modules/AddSphinxTarget.cmake @@ -48,10 +48,15 @@ function (add_sphinx_target builder project) # Handle installation if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) if (builder STREQUAL man) + if (CMAKE_INSTALL_MANDIR) + set(INSTALL_MANDIR ${CMAKE_INSTALL_MANDIR}/) + else() + set(INSTALL_MANDIR share/man/) + endif() # FIXME: We might not ship all the tools that these man pages describe install(DIRECTORY "${SPHINX_BUILD_DIR}/" # Slash indicates contents of COMPONENT "${project}-sphinx-man" - DESTINATION share/man/man1) + DESTINATION ${INSTALL_MANDIR}man1) elseif (builder STREQUAL html) string(TOUPPER "${project}" project_upper)