build FEATURE check for Doxygen presence
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a721c0..acb9960 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,10 +86,14 @@
install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR})
# generate doxygen documentation for libyang API
-add_custom_target(doc
- COMMAND doxygen ${CMAKE_BINARY_DIR}/Doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-configure_file(Doxyfile.in Doxyfile)
+find_package(Doxygen)
+if(DOXYGEN_FOUND)
+ set(DOXYGEN_SKIP_DOT TRUE)
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ configure_file(Doxyfile.in Doxyfile)
+endif()
# clean cmake cache
add_custom_target(cclean