aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-25 22:26:45 +0200
committerThomas White <taw@physics.org>2018-05-25 22:26:45 +0200
commitef1df9e3acefee9a1d1d71ec05191e4e33b28fc5 (patch)
tree80a92da47d37e7672e05cbf791faf2b94797bd1d /CMakeLists.txt
parent3f8db4b1884a95f4f52e744cb1639df80208381e (diff)
Make build of API documentation optional
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 16 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b8b9e5a..0f1dba72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,17 +97,22 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts
DESTINATION ${CMAKE_INSTALL_DOCDIR})
# API docs
-find_package(GtkDoc 1.25)
-if (GTKDOC_FOUND)
- configure_file(doc/reference/libcrystfel/xml/gtkdocentities.ent.cmake.in
- docs/xml/gtkdocentities.ent)
- configure_file(doc/reference/libcrystfel/CrystFEL-docs.sgml
- docs/CrystFEL-docs.sgml COPYONLY)
- add_custom_target(documentation ALL VERBATIM COMMAND
- ${CMAKE_SOURCE_DIR}/doc/reference/libcrystfel/build-docs)
- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html
- DESTINATION ${CMAKE_INSTALL_DOCDIR})
-endif (GTKDOC_FOUND)
+option(BUILD_API_DOCS "Build API documentation" OFF)
+if (BUILD_API_DOCS)
+ find_package(GtkDoc 1.25)
+ if (GTKDOC_FOUND)
+ configure_file(doc/reference/libcrystfel/xml/gtkdocentities.ent.cmake.in
+ docs/xml/gtkdocentities.ent)
+ configure_file(doc/reference/libcrystfel/CrystFEL-docs.sgml
+ docs/CrystFEL-docs.sgml COPYONLY)
+ add_custom_target(documentation ALL VERBATIM COMMAND
+ ${CMAKE_SOURCE_DIR}/doc/reference/libcrystfel/build-docs)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/html
+ DESTINATION ${CMAKE_INSTALL_DOCDIR})
+ else (GTKDOC_FOUND)
+ message(SEND_ERROR "gtk-doc not found")
+ endif (GTKDOC_FOUND)
+endif (BUILD_API_DOCS)
# ----------------------------------------------------------------------
# Build Target