summaryrefslogtreecommitdiff
path: root/docs/api/java/CMakeLists.txt
blob: 6df794435d71dda5de8daefb738d40f3d198fe24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
###############################################################################
# Top contributors (to current version):
#   Gereon Kremer
#
# This file is part of the cvc5 project.
#
# Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
# in the top-level source directory and their institutional affiliations.
# All rights reserved.  See the file COPYING in the top-level source
# directory for licensing information.
# #############################################################################
#
# Build system configuration for java API documentation.
#

add_custom_target(docs-java)

if(BUILD_BINDINGS_JAVA)
  find_package(Java REQUIRED)

  # put generated doc in a place where sphinx can easily copy from
  set(JAVADOC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/api/java)
  # used to trigger the rebuild
  set(JAVADOC_INDEX_FILE ${JAVADOC_OUTPUT_DIR}/index.html)

  get_target_property(CVC5_JAR_FILE cvc5jar JAR_FILE)
  add_custom_command(
    OUTPUT "${JAVADOC_INDEX_FILE}"
    COMMAND
      ${Java_JAVADOC_EXECUTABLE} io.github.cvc5.api
      -sourcepath ${CMAKE_SOURCE_DIR}/src/api/java/:${CMAKE_BINARY_DIR}/src/api/java/
      -Xdoclint:none
      -d ${JAVADOC_OUTPUT_DIR}
      -cp ${CVC5_JAR_FILE}
      -notimestamp
    COMMAND find ${JAVADOC_OUTPUT_DIR} -type f -exec sed -i'orig' 's/<!-- Generated by javadoc [^>]* -->//' {} "\;"
    COMMAND find ${SPHINX_GH_OUTPUT_DIR} -name '*orig' -delete
    DEPENDS cvc5jar
    COMMENT "Generating javadocs"
  )

  add_custom_target(docs-java-javadoc DEPENDS ${JAVADOC_INDEX_FILE})
  add_dependencies(docs-java docs-java-javadoc)
endif()

generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback