diff -u -r -N digikam-1.2.0-2/CMakeLists.txt digikam-1.2.0/CMakeLists.txt --- digikam-1.2.0-2/CMakeLists.txt 2010-09-25 18:01:53.000000000 +0200 +++ digikam-1.2.0/CMakeLists.txt 2010-09-25 18:05:16.000000000 +0200 @@ -1260,18 +1260,43 @@ # ================================================================================================== # API documentation generation -IF(DOXYGEN_FOUND) +# Checks if user ask to build documentation. +IF(BUILD_DOC) + IF(DOXYGEN_FOUND) - SET(API_DIR ${CMAKE_BINARY_DIR}/api) - SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}) - SET(DOXYFILE ${CMAKE_BINARY_DIR}/Doxyfile) - SET(WARNFILE ${CMAKE_BINARY_DIR}/doxygen-warn.log) + MESSAGE(STATUS "") + MESSAGE(STATUS "Documentation will be installed") + MESSAGE(STATUS "") - CONFIGURE_FILE(Doxyfile.cmake ${DOXYFILE}) + SET(API_DIR ${CMAKE_BINARY_DIR}/api) + SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}) + SET(DOXYFILE ${CMAKE_BINARY_DIR}/Doxyfile) + SET(WARNFILE ${CMAKE_BINARY_DIR}/doxygen-warn.log) - ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} ${DOXYFILE} - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + CONFIGURE_FILE(Doxyfile.cmake ${DOXYFILE}) + + ADD_CUSTOM_TARGET(doc ALL ${DOXYGEN_EXECUTABLE} ${DOXYFILE} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + + ELSE(DOXYGEN_FOUND) + + MESSAGE(STATUS "") + MESSAGE(STATUS "Documentation will NOT be installed") + MESSAGE(STATUS "Doxygen wasn't found on the system") + MESSAGE(STATUS "") + + ENDIF(DOXYGEN_FOUND) + +ELSE(BUILD_DOC) + + MESSAGE(STATUS "") + MESSAGE(STATUS "Documentation will NOT be installed") + MESSAGE(STATUS "Because the option -DBUILD_DOC=ON wasn't passed to cmake") + MESSAGE(STATUS "") + +ENDIF(BUILD_DOC) -ENDIF(DOXYGEN_FOUND) include(MacroOptionalAddSubdirectory) macro_optional_add_subdirectory( po ) + +add_subdirectory( doc )