if(SAMPGDK_BUILD_DOCS)
  find_package(Doxygen)
endif()

if(DOXYGEN_FOUND)
  configure_file(Doxyfile.in Doxyfile @ONLY)
  add_custom_target(sampgdk_doc ALL
                    COMMAND ${DOXYGEN_EXECUTABLE}
                    COMMENT "Building Doxygen documentation"
                    DEPENDS sampgdk)
  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
          DESTINATION share/doc/sampgdk
          COMPONENT doc
          FILES_MATCHING REGEX html/.*)
endif()

if(SAMPGDK_BUILD_DOCS)
  find_package(Doxygen)
endif()

if(DOXYGEN_FOUND)
  configure_file(Doxyfile.in Doxyfile @ONLY)

  add_custom_target(sampgdk_doc ALL
                    COMMAND ${DOXYGEN_EXECUTABLE}
                    COMMENT "Building Doxygen documentation"
                    DEPENDS sampgdk)
  if(CMAKE_GENERATOR MATCHES "Makefile")
    add_custom_target(doc DEPENDS sampgdk_doc)
  endif()

  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
          DESTINATION share/doc/sampgdk
          COMPONENT doc
          FILES_MATCHING REGEX html/.*)
endif()

Add 'doc' target as an alias for 'sampgdk_doc'
Add 'doc' target as an alias for 'sampgdk_doc'

But only for Makefile generators.
