CMake: report CMake version
[libftdi] / CMakeLists.txt
index f36912d..39857a2 100644 (file)
@@ -1,5 +1,7 @@
 cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 
+message(STATUS "CMake version: ${CMAKE_VERSION}")
+
 # Project
 project(libftdi1 C)
 set(MAJOR_VERSION 1)
@@ -142,27 +144,7 @@ add_custom_target(dist
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
 if ( DOCUMENTATION )
-  find_package ( Doxygen REQUIRED)
-
-  # Copy doxy.config.in
-  set(top_srcdir ${CMAKE_SOURCE_DIR})
-  configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
-  configure_file(${CMAKE_SOURCE_DIR}/doc/Doxyfile.xml.in ${CMAKE_BINARY_DIR}/Doxyfile.xml )
-
-  # Run doxygen
-  add_custom_command(
-    OUTPUT ${CMAKE_BINARY_DIR}/doc/html/index.html
-    COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/doc
-    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
-    COMMENT "Generating API documentation"
-    DEPENDS ${c_headers};${c_sources};${cpp_sources};${cpp_headers}
-  )
-
-  add_custom_target(
-    docs ALL
-    COMMENT "Documentation target docs"
-    DEPENDS ${CMAKE_BINARY_DIR}/doc/html/index.html
-  )
+  add_subdirectory(doc)
 endif ( DOCUMENTATION )
 
 add_subdirectory(src)