macro(ADD_DOCUMENTATION TARGET DOXYGEN_CONFIG_FILE)
	if(DOXYGEN_FOUND)
		configure_file("${PROJECT_SOURCE_DIR}/${DOXYGEN_CONFIG_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/doxyfile-${TARGET}")
		add_custom_target("genereate.${TARGET}" COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxyfile-${TARGET})
		add_custom_target("${TARGET}" COMMAND ${CMAKE_COMMAND} -D COMPONENT=doc -P cmake_install.cmake)
		add_dependencies("${TARGET}" "genereate.${TARGET}")
	else(DOXYGEN_FOUND)
		message(STATUS "Doxygen not found, can`t generate documentation")
	endif(DOXYGEN_FOUND)
endmacro(ADD_DOCUMENTATION)
