# -*- mode: cmake -*- # $Id$ option(HLT_DOC "Create and install the HLT API documentation (requires Doxygen)" OFF) IF(HLT_DOC) FIND_PACKAGE(Doxygen) IF(NOT DOXYGEN_FOUND) MESSAGE(FATAL_ERROR "Doxygen is needed to build the documentation.") ENDIF() SET(HLT_doxy_depend doc/mainpage.c) SET(HLT_doxy_input) SET(HLT_doxy_source_paths doc BASE SampleLib rec exa shuttle sim global trigger TPCLib MUON ) SET(HLT_doxy_source_exclude_paths ${CMAKE_CURRENT_SOURCE_DIR}/TPCLib/tracking-ca/cagpu) FOREACH(mypath ${HLT_doxy_source_paths}) SET(HLT_doxy_input "${HLT_doxy_input} ${CMAKE_CURRENT_SOURCE_DIR}/${mypath}") FILE(GLOB_RECURSE tmpvar ${mypath}/*.[h,c,cxx,C]) SET(HLT_doxy_depend ${HLT_doxy_depend} ${tmpvar}) ENDFOREACH(mypath ${HLT_doxy_source_paths}) SET( HLT_doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen.conf.in ) SET( HLT_doxy_image_path ${CMAKE_CURRENT_SOURCE_DIR}/doc/pics ) SET( HLT_doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ) SET( HLT_doxy_html_index_file ${CMAKE_CURRENT_BINARY_DIR}/html/index.html ) SET( HLT_doxy_output_root ${CMAKE_CURRENT_BINARY_DIR} ) CONFIGURE_FILE( ${HLT_doxyfile_in} ${HLT_doxyfile} @ONLY ) ADD_CUSTOM_COMMAND( OUTPUT ${HLT_doxy_html_index_file} COMMAND ${DOXYGEN_EXECUTABLE} ${HLT_doxyfile} # The following should be ${doxyfile} only but it # will break the dependency. # The optimal solution would be creating a # custom_command for ${doxyfile} generation # but I still have to figure out how... MAIN_DEPENDENCY ${HLT_doxyfile} ${HLT_doxyfile_in} DEPENDS ${HLT_doxy_depend} COMMENT "Generating HLT HTML documentation") ADD_CUSTOM_TARGET( hltdoc DEPENDS ${HLT_doxy_html_index_file} ) #Have to create html dir, otherwise install fails if doc hasn't been build FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html) INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION doc/HLT ) ENDIF(HLT_DOC)