Doxygen skeleton

Change-Id: I2bd370c9cfd9e86a4d11c5b2bca3cf6aca031076
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fa2341..bf49f98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,5 +31,21 @@
 # configurations. They are warnings, not errors.
 set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic ${CMAKE_CXX_FLAGS}")
 
+find_package(Doxygen)
+option(WITH_DOCS "Create and install internal documentation (needs Doxygen)" ${DOXYGEN_FOUND})
+
 find_package(docopt REQUIRED)
 find_package(spdlog REQUIRED)
+
+if(WITH_DOCS)
+    set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
+    set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+    configure_file(${doxyfile_in} ${doxyfile} @ONLY)
+    add_custom_target(doc
+        COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+        COMMENT "Generating API documentation with Doxygen"
+        VERBATIM
+        SOURCES ${doxyfile_in}
+        )
+endif()
diff --git a/Doxyfile.in b/Doxyfile.in
new file mode 100644
index 0000000..dbdefab
--- /dev/null
+++ b/Doxyfile.in
@@ -0,0 +1,8 @@
+PROJECT_NAME = "@CMAKE_PROJECT_NAME@"
+PROJECT_NUMBER = "@CLA_SYSREPO_VERSION@"
+STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
+INPUT = @doxy_main_page@ @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@
+FILE_PATTERNS = *.h *.cpp *.md *.cmake *.yang
+RECURSIVE = YES
+EXTRACT_ANON_NSPACES = YES
+USE_MDFILE_AS_MAINPAGE = index.md
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..3c1c3fc
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,7 @@
+# High-level overview
+
+This project is a fancy CLI tool for working with devices via [NETCONF](https://en.wikipedia.org/wiki/NETCONF).
+
+## Why?
+
+We needed something to perform remote management of [CzechLight optical devices](http://czechlight.cesnet.cz/).