Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Fix the option to disable man pages #2161

Merged
merged 3 commits into from
Jan 21, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ find_package(Sphinx QUIET)

if(SPHINX_FOUND)
message(STATUS "Sphinx Found, configuring.")
option(FREECIV_ENABLE_MANPAGES "Enable manpages" ON)
set(SPHINX_SOURCE ${CMAKE_SOURCE_DIR}/docs)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
set(SPHINX_MAN ${CMAKE_CURRENT_BINARY_DIR}/man)
Expand All @@ -16,14 +15,17 @@ if(SPHINX_FOUND)
COMMENT "Generating documentation with Sphinx")

# We only create man pages on Unix
if(UNIX AND NOT APPLE)
add_custom_target(man-pages ALL
COMMAND
${SPHINX_EXECUTABLE} -b man ${SPHINX_SOURCE} ${SPHINX_MAN}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating manual pages with Sphinx")
if((UNIX AND NOT APPLE) OR FREECIV_ENABLE_MANPAGES)
option(FREECIV_ENABLE_MANPAGES "Enable manpages" ON)

if(FREECIV_ENABLE_MANPAGES)
add_custom_target(man-pages ALL
COMMAND
${SPHINX_EXECUTABLE} -b man ${SPHINX_SOURCE} ${SPHINX_MAN}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating manual pages with Sphinx")
endif()
endif()
else()
message(STATUS "Sphinx NOT Found.")
option(FREECIV_ENABLE_MANPAGES "Enable manpages" OFF)
endif()
Loading