$OpenBSD: patch-docs_CMakeLists_txt,v 1.2 2017/01/31 09:58:35 sthen Exp $
1. This directory is already covered by BUILD_DOC option, so
   no reason to not to add "doc" target in build-by-default list;
2. Actually depend on configured file, CMake already takes care on
   depending on source file;
3. No need for GLOB, we can simply use "INSTALL(DIRECTORY foo/"
   syntax here.
--- docs/CMakeLists.txt.orig	Sun Nov 15 18:07:26 2015
+++ docs/CMakeLists.txt	Sun Jan 29 09:59:09 2017
@@ -12,15 +12,15 @@ CONFIGURE_FILE(doxyfile.in.cmake ${DOXYFILE} @ONLY)
 
 # now build documentation
 ADD_CUSTOM_TARGET(doc
-  ALL
   COMMAND "${DOXYGEN_EXECUTABLE}"
-  DEPENDS "${DOXYFILE}" manual-main.txt ../include/lensfun/lensfun.h.in
+  DEPENDS doxyfile.in.cmake manual-main.txt ../include/lensfun/lensfun.h.in
   WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
   COMMENT "Building documentation with doxygen"
 )
 
 # install documentation  
-INSTALL(DIRECTORY ${CMAKE_DOC_OUT}/ DESTINATION ${CMAKE_INSTALL_DOCDIR})
+FILE(GLOB doc_files "${CMAKE_DOC_OUT}/*.*")
+INSTALL(FILES ${doc_files} DESTINATION ${DOCDIR})
 
 # create and install man pages
 FIND_PROGRAM(RST2MAN_EXECUTABLE NAMES rst2man rst2man.py rst2man2 rst2man2.py)
