cmake_minimum_required(VERSION 3.9)
include(helpers.cmake)
find_package(Doxygen REQUIRED)
find_package(Perl REQUIRED)
option(GINKGO_DOC_GENERATE_PDF "Generate PDF documentation" OFF)
option(GINKGO_DOC_GENERATE_DEV "Generate internal documentation" OFF)
option(GINKGO_DOC_GENERATE_EXAMPLES "Generate example documentation" ON)
if(GINKGO_DOC_GENERATE_EXAMPLES)
    add_subdirectory(examples)
endif()

if (GINKGO_DOC_GENERATE_PDF)
    find_package(LATEX COMPONENTS PDFLATEX REQUIRED)
endif()

ginkgo_doc_gen(usr Doxyfile-usr.in OFF USR_DOC.md)
if (GINKGO_DOC_GENERATE_DEV)
    ginkgo_doc_gen(dev Doxyfile-dev.in OFF DEV_DOC.md)
endif()
if (GINKGO_DOC_GENERATE_PDF)
    ginkgo_doc_gen(pdf Doxyfile-pdf.in ON PDF_DOC.md)
endif()
