667a749
--- a/src/doc/CMakeLists.txt
667a749
+++ b/src/doc/CMakeLists.txt
85af7b2
@@ -6,10 +6,11 @@ set (public_docs
85af7b2
      "${OpenImageIO_SOURCE_DIR}/CHANGES.md"
85af7b2
 )
85af7b2
 
85af7b2
-install (FILES ${public_docs}
85af7b2
-         DESTINATION ${CMAKE_INSTALL_DOCDIR}
85af7b2
-         COMPONENT documentation)
85af7b2
-
85af7b2
+if (INSTALL_DOCS)
85af7b2
+    install (FILES ${public_docs}
85af7b2
+             DESTINATION ${CMAKE_INSTALL_DOCDIR}
85af7b2
+             COMPONENT documentation)
85af7b2
+endif()
85af7b2
 
85af7b2
 # generate man pages using txt2man and a tiny python script to munge the
85af7b2
 # result of "$tool --help"
85af7b2
@@ -19,8 +20,7 @@ if (UNIX AND TXT2MAN AND PYTHONINTERP_FO
667a749
     message (STATUS "Unix man page documentation will be generated")
667a749
     set (cli_tools oiiotool iinfo maketx idiff igrep iconvert)
667a749
 
667a749
-    find_program (IV_FOUND iv)
667a749
-    if (IV_FOUND)
667a749
+    if (TARGET iv)
667a749
         list (APPEND cli_tools iv)
667a749
     endif()
667a749
 
85af7b2
@@ -37,7 +37,9 @@ if (UNIX AND TXT2MAN AND PYTHONINTERP_FO
85af7b2
     # force man page build before install
85af7b2
     add_custom_target (man_pages ALL DEPENDS ${manpage_files})
85af7b2
 
85af7b2
+if (INSTALL_DOCS)
85af7b2
     install (FILES ${manpage_files}
85af7b2
              DESTINATION ${CMAKE_INSTALL_MANDIR}
85af7b2
              COMPONENT documentation)
85af7b2
 endif()
85af7b2
+endif()
85af7b2
--- a/CMakeLists.txt
85af7b2
+++ b/CMakeLists.txt
85af7b2
@@ -101,6 +101,9 @@ set (TEX_BATCH_SIZE "" CACHE STRING "For
85af7b2
 set (SOVERSION ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}
85af7b2
      CACHE STRING "Set the SO version in the SO name of the output library")
85af7b2
 option (BUILD_OIIOUTIL_ONLY "If ON, will build *only* libOpenImageIO_Util")
85af7b2
+option (BUILD_DOCS "If ON, build documentation and man pages.")
85af7b2
+option (INSTALL_DOCS "If ON, install documentation and man pages.")
85af7b2
+
85af7b2
 
85af7b2
 if (NOT OIIO_THREAD_ALLOW_DCLP)
85af7b2
     add_definitions ("-DOIIO_THREAD_ALLOW_DCLP=0")
85af7b2
@@ -188,7 +191,7 @@ if (USE_PYTHON AND NOT BUILD_OIIOUTIL_ON
85af7b2
 endif ()
85af7b2
 
85af7b2
 add_subdirectory (src/include)
85af7b2
-if (INSTALL_DOCS)
85af7b2
+if (BUILD_DOCS)
85af7b2
     add_subdirectory (src/doc)
85af7b2
 endif ()
85af7b2
 add_subdirectory (src/fonts)