doxygen.cmake revision 0bbfda8a
10bbfda8aSnia# Setup doxygen stuff.  Only really of interest to devs...
20bbfda8aSnia
30bbfda8aSniafind_package(Doxygen)
40bbfda8aSniaif(DOXYGEN_FOUND)
50bbfda8aSnia	# Few configurable params
60bbfda8aSnia	if(NOT DOXYGEN_DIR)
70bbfda8aSnia		set(DOXYGEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
80bbfda8aSnia	endif()
90bbfda8aSnia	if(NOT DOXYGEN_HAVE_DOT)
100bbfda8aSnia		# String YES/NO; let user override what find_package() got.
110bbfda8aSnia		set(DOXYGEN_HAVE_DOT ${DOXYGEN_DOT_FOUND})
120bbfda8aSnia	endif()
130bbfda8aSnia	if(NOT DOXYGEN_GRAPHIC_CALLGRAPHS)
140bbfda8aSnia		# String YES/NO.  These are expensive to generate and big.
150bbfda8aSnia		set(DOXYGEN_GRAPHIC_CALLGRAPHS "NO")
160bbfda8aSnia	endif()
170bbfda8aSnia
180bbfda8aSnia	# The config codes the paths to the files, so we need to set them
190bbfda8aSnia	configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
200bbfda8aSnia		"${DOXYGEN_DIR}/Doxyfile" @ONLY)
210bbfda8aSnia
220bbfda8aSnia	# Special target, since it hardly ever gets used.  We need to pull in
230bbfda8aSnia	# the various generated source files, and the easiest way to ensure
240bbfda8aSnia	# they're all these is to just build ctwm.  That gets a little
250bbfda8aSnia	# tedious when working on docs though, so try depending on CTWMSRC.
260bbfda8aSnia	# That seems to work well enough, and if we find edge cases that
270bbfda8aSnia	# break it...   well, it's a tool for devs, not end users, so we can
280bbfda8aSnia	# afford the possibility of surprises.
290bbfda8aSnia	add_custom_target(doxygen
300bbfda8aSnia		DEPENDS ${CTWMSRC}
310bbfda8aSnia		COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_DIR}/Doxyfile
320bbfda8aSnia		WORKING_DIRECTORY ${DOXYGEN_DIR}
330bbfda8aSnia		COMMENT "Generating Doxygen documentation in ${DOXYGEN_DIR}"
340bbfda8aSnia		VERBATIM)
350bbfda8aSnia
360bbfda8aSnia	add_custom_target(doxyclean
370bbfda8aSnia		COMMAND rm -rf ${DOXYGEN_DIR}/html
380bbfda8aSnia		COMMENT "Cleaning up Doxygen docs")
390bbfda8aSniaendif(DOXYGEN_FOUND)
40