find_package(Doxygen QUIET)

if(DOXYGEN_FOUND)
	set(doxygen_FOUND TRUE)
	set(USE_DOXYGEN TRUE CACHE BOOL "Build documentation using Doxygen.")
	message(STATUS "Doxygen was found!")
else()
	set(doxygen_FOUND FALSE)
	set(USE_DOXYGEN FALSE CACHE BOOL "Build documentation using Doxygen.")
endif()

if(USE_DOXYGEN)
	message(STATUS "Doxygen will be used to build documentation.")
endif()

if(USE_DOXYGEN)
	find_package(Doxygen REQUIRED)
	option(FORCE_DOCS "Force Doxygen to rebuild all documentation each build." FALSE)
	message(STATUS "Doxygen can now be used to build documentation. To do this automatically each build, set the <FORCE_DOCS> flag to true.")
endif()
