@ -147,17 +147,6 @@ endif()
# = = = = = = = = = D o x y g e n d o c s = = = = = = = = =
macro ( make_reference result modules_list black_list )
set ( _res )
foreach ( m ${ ${modules_list } } )
list ( FIND ${ black_list } ${ m } _pos )
if ( ${ _pos } EQUAL -1 )
set ( _res "${_res} @ref ${m} | ${m} \n" )
endif ( )
endforeach ( )
set ( ${ result } ${ _res } )
endmacro ( )
if ( BUILD_DOCS AND HAVE_DOXYGEN )
# n o t d o c u m e n t e d m o d u l e s l i s t
list ( APPEND blacklist "ts" "java" "python2" "python3" "world" )
@ -166,6 +155,10 @@ if(BUILD_DOCS AND HAVE_DOXYGEN)
set ( paths_include )
set ( paths_doc )
set ( paths_bib )
set ( paths_sample )
set ( paths_tutorial )
set ( refs_main )
set ( refs_extra )
set ( deps )
foreach ( m ${ BASE_MODULES } ${ EXTRA_MODULES } )
list ( FIND blacklist ${ m } _pos )
@ -182,40 +175,79 @@ if(BUILD_DOCS AND HAVE_DOXYGEN)
list ( APPEND paths_doc "${docs_dir}" )
list ( APPEND deps ${ docs_dir } )
endif ( )
# s a m p l e f o l d e r
set ( sample_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/samples" )
if ( EXISTS "${sample_dir}" )
list ( APPEND paths_sample "${sample_dir}" )
list ( APPEND deps ${ sample_dir } )
endif ( )
# t u t o r i a l f o l d e r
set ( tutorial_dir "${OPENCV_MODULE_opencv_${m}_LOCATION}/tutorials" )
if ( EXISTS "${tutorial_dir}" )
list ( APPEND paths_tutorial "${tutorial_dir}" )
list ( APPEND deps ${ tutorial_dir } )
endif ( )
# B i B T e X f i l e
set ( bib_file "${docs_dir}/${m}.bib" )
if ( EXISTS "${bib_file}" )
set ( paths_bib "${paths_bib} ${bib_file}" )
list ( APPEND deps ${ bib_file } )
endif ( )
# R e f e r e n c e e n t r y
# set ( one_ref "@ref ${m} | ${m}\n" )
set ( one_ref "\t- ${m}. @ref ${m}\n" )
list ( FIND EXTRA_MODULES ${ m } _pos )
if ( ${ _pos } EQUAL -1 )
set ( refs_main "${refs_main}${one_ref}" )
else ( )
set ( refs_extra "${refs_extra}${one_ref}" )
endif ( )
endif ( )
endforeach ( )
# f i x r e f e r e n c e s
# set ( ref_header "Module name | Folder\n----------- | ------" )
# if ( refs_main )
# set ( refs_main "### Main modules\n${ref_header}\n${refs_main}" )
# endif ( )
# if ( refs_extra )
# set ( refs_extra "### Extra modules\n${ref_header}\n${refs_extra}" )
# endif ( )
if ( refs_main )
set ( refs_main "- Main modules:\n${refs_main}" )
endif ( )
if ( refs_extra )
set ( refs_extra "- Extra modules:\n${refs_extra}" )
endif ( )
# a d d i t i o n a l c o n f i g
set ( doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" )
set ( rootfile "${CMAKE_CURRENT_BINARY_DIR}/root.markdown" )
set ( bibfile "${CMAKE_CURRENT_SOURCE_DIR}/opencv.bib" )
set ( faqfile "${CMAKE_CURRENT_SOURCE_DIR}/faq.markdown" )
set ( tutorial_path "${CMAKE_CURRENT_SOURCE_DIR}/tutorials" )
set ( tutorial_py_path "${CMAKE_CURRENT_SOURCE_DIR}/py_tutorials" )
set ( user_guide_path "${CMAKE_CURRENT_SOURCE_DIR}/user_guide" )
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${paths_include} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${user_guide_path}" )
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path}" )
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXAMPLE_PATH "${CMAKE_SOURCE_DIR}/samples ; ${paths_doc}" )
set ( example_path "${CMAKE_SOURCE_DIR}/samples" )
# s e t e x p o r t v a r i a b l e s
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_INPUT_LIST "${rootfile} ; ${faqfile} ; ${paths_include} ; ${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${user_guide_path} ; ${paths_tutorial}" )
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_IMAGE_PATH "${paths_doc} ; ${tutorial_path} ; ${tutorial_py_path} ; ${user_guide_path} ; ${paths_tutorial}" )
# T O D O : r e m o v e p a t h s _ d o c f r o m E X A M P L E _ P A T H a f t e r f a c e m o d u l e t u t o r i a l s / s a m p l e s m o v e d t o s e p a r a t e f o l d e r s
string ( REPLACE ";" " \\\n" CMAKE_DOXYGEN_EXAMPLE_PATH "${example_path} ; ${paths_doc} ; ${paths_sample}" )
set ( CMAKE_DOXYGEN_LAYOUT "${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml" )
set ( CMAKE_DOXYGEN_OUTPUT_PATH "doxygen" )
set ( CMAKE_DOXYGEN_MAIN_REFERENCE "${refs_main}" )
set ( CMAKE_DOXYGEN_EXTRA_REFERENCE "${refs_extra}" )
set ( CMAKE_EXTRA_BIB_FILES "${bibfile} ${paths_bib}" )
# g e n e r a t e r e f e r e n c e s
make_reference ( CMAKE_DOXYGEN_MAIN_REFERENCE BASE_MODULES blacklist )
make_reference ( CMAKE_DOXYGEN_EXTRA_REFERENCE EXTRA_MODULES blacklist )
# w r i t i n g f i l e
configure_file ( Doxyfile.in ${ doxyfile } @ONLY )
configure_file ( root.markdown.in ${ rootfile } @ONLY )
configure_file ( mymath.sty "${CMAKE_DOXYGEN_OUTPUT_PATH}/html/mymath.sty" @ONLY )
configure_file ( mymath.sty "${CMAKE_DOXYGEN_OUTPUT_PATH}/latex/mymath.sty" @ONLY )
# T O D O : d o n o t s t o r e d o w n l o a d a b l e s a m p l e s , b u t g i v e g i t h u b l i n k i n s t e a d
add_custom_target ( doxygen
C O M M A N D " $ { C M A K E _ C O M M A N D } " - E c o p y _ d i r e c t o r y " $ { C M A K E _ S O U R C E _ D I R } / s a m p l e s " " $ { C M A K E _ D O X Y G E N _ O U T P U T _ P A T H } / h t m l / s a m p l e s "
C O M M A N D " $ { C M A K E _ C O M M A N D } " - E c o p y " $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / p a t t e r n . p n g " " $ { C M A K E _ D O X Y G E N _ O U T P U T _ P A T H } / h t m l "