# Find Asciidoctor - a better AsciiDoc
#
# ASCIIDOCTOR_FOUND
# ASCIIDOCTORPDF_FOUND
# ASCIIDOCTOR_EXECUTABLE
# ASCIIDOCTORPDF_EXECUTABLE

FIND_PROGRAM(ASCIIDOCTOR_EXECUTABLE asciidoctor)
FIND_PROGRAM(ASCIIDOCTORPDF_EXECUTABLE asciidoctor-pdf)

MARK_AS_ADVANCED(ASCIIDOCTOR_EXECUTABLE)
MARK_AS_ADVANCED(ASCIIDOCTORPDF_EXECUTABLE)

IF (NOT ASCIIDOCTOR_EXECUTABLE)
  SET(ASCIIDOCTOR_FOUND "NO")
ELSE (NOT ASCIIDOCTOR_EXECUTABLE)
  SET(ASCIIDOCTOR_FOUND "YES")
ENDIF (NOT ASCIIDOCTOR_EXECUTABLE)

IF (NOT ASCIIDOCTORPDF_EXECUTABLE)
  SET(ASCIIDOCTORPDF_FOUND "NO")
ELSE (NOT ASCIIDOCTORPDF_EXECUTABLE)
  SET(ASCIIDOCTORPDF_FOUND "YES")
ENDIF (NOT ASCIIDOCTORPDF_EXECUTABLE)

IF (NOT ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_FIND_REQUIRED)
  MESSAGE(FATAL_ERROR "Could not find asciidoctor")
ENDIF (NOT ASCIIDOCTOR_FOUND AND ASCIIDOCTOR_FIND_REQUIRED)

IF (NOT ASCIIDOCTORPDF_FOUND AND ASCIIDOCTOR_FIND_REQUIRED)
  MESSAGE(FATAL_ERROR "Could not find asciidoctor-pdf")
ENDIF (NOT ASCIIDOCTORPDF_FOUND AND ASCIIDOCTOR_FIND_REQUIRED)

