Skip to content

Commit

Permalink
Support build without manpages on Unix-like OS
Browse files Browse the repository at this point in the history
If `FREECIV_ENABLE_MANPAGES` was set to `OFF` and Sphinx was available,
this setting was ignored during the build on Unix-like systems.

This commit fixes this issue.
  • Loading branch information
blabber authored and lmoureaux committed Mar 16, 2024
1 parent 9e16bd9 commit 76c4e3c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ if(SPHINX_FOUND)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Sphinx")

# We only create man pages on Unix or if the user explicitly requested it.
if((UNIX AND NOT APPLE) OR FREECIV_ENABLE_MANPAGES)
# We only create man pages on Unix by default or if the user explicitly
# requested it.
if(UNIX AND NOT APPLE AND NOT DEFINED FREECIV_ENABLE_MANPAGES)
option(FREECIV_ENABLE_MANPAGES "Enable manpages" ON)
else()
option(FREECIV_ENABLE_MANPAGES "Enable manpages" OFF)
endif()

if(FREECIV_ENABLE_MANPAGES)
add_custom_target(man-pages ALL
COMMAND
${SPHINX_EXECUTABLE} -b man ${SPHINX_SOURCE} ${SPHINX_MAN}
Expand All @@ -31,6 +36,3 @@ if(SPHINX_FOUND)
else()
message(STATUS "Sphinx NOT Found.")
endif()

# Default to OFF, if FREECIV_ENABLE_MANPAGES is not set yet.
option(FREECIV_ENABLE_MANPAGES "Enable manpages" OFF)

0 comments on commit 76c4e3c

Please sign in to comment.