[cmake] options.cmake: Add an option to disable installation of documentation.

Some distributions install documentation using distro-specific build
scripts, so add an option to allow our documentation install to be
disabled.

Specify -DINSTALL_DOC=OFF on the CMake command line.
This commit is contained in:
David Korth 2023-02-10 18:49:46 -05:00
parent 0d98d8aec6
commit e7867b7d21
2 changed files with 16 additions and 10 deletions

View File

@ -146,11 +146,13 @@ IF(ENABLE_NLS)
ADD_SUBDIRECTORY(locale)
ENDIF(ENABLE_NLS)
# Project subdirectories.
# Project subdirectories
ADD_SUBDIRECTORY(extlib)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(xdg)
IF(INSTALL_DOC)
ADD_SUBDIRECTORY(doc)
ENDIF(INSTALL_DOC)
### Build summary ###
@ -327,14 +329,15 @@ SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
#SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/doc/WELCOME.txt")
# Additional document files for the root directory.
# TODO: Convert from Unix line endings to Windows when
# compiling for Windows?
INCLUDE(DirInstallPaths)
INSTALL(FILES NETWORK.md
DESTINATION "${DIR_INSTALL_DOC_ROOT}"
COMPONENT "doc"
)
IF(INSTALL_DOC)
# Additional document files for the root directory.
# TODO: Convert from Unix line endings to Windows when
# compiling for Windows?
INCLUDE(DirInstallPaths)
INSTALL(FILES NETWORK.md
DESTINATION "${DIR_INSTALL_DOC_ROOT}"
COMPONENT "doc")
ENDIF(INSTALL_DOC)
# CPack: Source package settings.
# NOTE: Double-escape is required because the unescaped

View File

@ -151,3 +151,6 @@ ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Achievements. (TODO: "AUTO" option?)
OPTION(ENABLE_ACHIEVEMENTS "Enable achievement pop-ups." ON)
# Install documentation
OPTION(INSTALL_DOC "Install documentation." ON)