0027383: Modeling - improve handling of regularity on edges
[occt.git] / dox / CMakeLists.txt
CommitLineData
adc33035 1project (Overview)
2
3# directory that contains all raw OCCT overview articles (markdown format)
4set (OCCT_OVERVIEW_DIR "${CMAKE_SOURCE_DIR}/dox")
5
6# directory that contains resources for the generation of OCCT documentation
7set (OCCT_OVERVIEW_RESOURCE_DIR "${OCCT_OVERVIEW_DIR}/resources")
8
9# directory that contains all generated OCCT articles
10set (OCCT_GENERATED_DOC_DIR "${CMAKE_BINARY_DIR}/doc")
11if (NOT EXISTS "${OCCT_GENERATED_DOC_DIR}")
12 file (MAKE_DIRECTORY "${OCCT_GENERATED_DOC_DIR}")
13endif()
14
15# directory that contains generated OCCT overview articles
16set (OCCT_GENERATED_OVERVIEW_DIR "${OCCT_GENERATED_DOC_DIR}/overview")
17if (NOT EXISTS "${OCCT_GENERATED_OVERVIEW_DIR}")
18 file (MAKE_DIRECTORY "${OCCT_GENERATED_OVERVIEW_DIR}")
19endif()
20
21# directory that contains generated OCCT overview articles in html format
22set (OCCT_GENERATED_HTML_OVERVIEW_DIR "${OCCT_GENERATED_OVERVIEW_DIR}/html")
23if (NOT EXISTS "${OCCT_GENERATED_HTML_OVERVIEW_DIR}")
24 file (MAKE_DIRECTORY "${OCCT_GENERATED_HTML_OVERVIEW_DIR}")
25endif()
26
27# read OCCT articles that should be generated
28set (OCCT_ARTICLES "")
29if (EXISTS "${OCCT_OVERVIEW_DIR}/FILES_HTML.txt" )
30 file (STRINGS "${OCCT_OVERVIEW_DIR}/FILES_HTML.txt" OCCT_ARTICLES REGEX "^[^#]+")
31else()
32 message (FATAL_ERROR "FILES_HTML.txt is not found in ${OCCT_OVERVIEW_DIR}")
33endif()
34
35# configuration file for doxygen
36set (OCCT_CONFIG_FOR_DOXYGEN "${OCCT_GENERATED_DOC_DIR}/occt.cfg")
37
ce73cfd0 38set (3RDPARTY_MATHJAX_RELATIVE_PATH "https://cdn.mathjax.org/mathjax/latest")
adc33035 39
adc33035 40configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CONFIG_FOR_DOXYGEN}" COPYONLY)
41
42# Add common options for generation of Overview and User Guides
096ef695 43file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}")
adc33035 44file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nOUTPUT_DIRECTORY = ${OCCT_GENERATED_OVERVIEW_DIR}/.")
45file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_LOGO = ${OCCT_OVERVIEW_DIR}/resources/occ_logo.png")
46
47set (OCCT_ARTICLE_PARAM_INPUT "INPUT =")
48set (OCCT_ARTICLE_PARAM_IMAGEPATH "IMAGE_PATH = ${OCCT_OVERVIEW_DIR}/resources/ ")
49
50set (OCCT_ARTICLES_ABSPATH "")
51foreach (OCCT_ARTICLE ${OCCT_ARTICLES})
52 get_filename_component (OCCT_ARTICLE_ABSOLUTE_PATH "${OCCT_OVERVIEW_DIR}/${OCCT_ARTICLE}" ABSOLUTE)
53 get_filename_component (OCCT_ARTICLE_PARENT_DIR "${OCCT_ARTICLE_ABSOLUTE_PATH}" PATH)
54
55 if (EXISTS "${OCCT_ARTICLE_PARENT_DIR}/images")
56 set (OCCT_ARTICLE_PARAM_IMAGEPATH "${OCCT_ARTICLE_PARAM_IMAGEPATH} ${OCCT_ARTICLE_PARENT_DIR}/images")
57 endif()
58
59 set (OCCT_ARTICLE_PARAM_INPUT "${OCCT_ARTICLE_PARAM_INPUT} ${OCCT_ARTICLE_ABSOLUTE_PATH}")
60
61 set (SOURCE_GROUP_NAME "")
62
63 # add the file to appropriate source group
64 get_filename_component (CURRENT_TAIL_PATH "${OCCT_ARTICLE}" PATH)
65 while (CURRENT_TAIL_PATH AND NOT "${CURRENT_TAIL_PATH}" STREQUAL "..")
66 get_filename_component (CURRENT_DIR_NAME "${CURRENT_TAIL_PATH}" NAME)
67 set (SOURCE_GROUP_NAME "${CURRENT_DIR_NAME}\\${SOURCE_GROUP_NAME}")
68
69 # one step out (get parent directory)
70 get_filename_component (CURRENT_TAIL_PATH "${CURRENT_TAIL_PATH}" PATH)
71 endwhile()
72 SOURCE_GROUP ("${SOURCE_GROUP_NAME}" FILES ${OCCT_ARTICLE_ABSOLUTE_PATH})
73
74 list (APPEND OCCT_ARTICLES_ABSPATH ${OCCT_ARTICLE_ABSOLUTE_PATH})
75endforeach()
76
77file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\n${OCCT_ARTICLE_PARAM_INPUT}")
78file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\n${OCCT_ARTICLE_PARAM_IMAGEPATH}")
79
80# Add document type-specific options
81# generate tree view
82file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nGENERATE_TREEVIEW = YES")
83
84# HTML Search engine options
85file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nSEARCHENGINE = YES")
86file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nSERVER_BASED_SEARCH = YES")
87file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nEXTERNAL_SEARCH = NO")
88
89# Formula options
90file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nMATHJAX_RELPATH = ${3RDPARTY_MATHJAX_RELATIVE_PATH}")
91
92# Copy index file to provide fast access to HTML documentation
93file(COPY "${OCCT_OVERVIEW_RESOURCE_DIR}/index.html" DESTINATION "${OCCT_GENERATED_OVERVIEW_DIR}")
94
75378f50 95# get relative paths to documentation source files
96file (GLOB_RECURSE OCCT_OVERVIEW_FILES "${OCCT_OVERVIEW_DIR}/*")
97
98add_custom_command(OUTPUT "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png"
99 COMMAND ${3RDPARTY_DOXYGEN_EXECUTABLE} ${OCCT_CONFIG_FOR_DOXYGEN}
100 DEPENDS ${OCCT_OVERVIEW_FILES}
101 WORKING_DIRECTORY ${OCCT_GENERATED_DOC_DIR}
102 COMMENT "Generating OCCT overview documentation with Doxygen"
103 VERBATIM
104)
105
106add_custom_target(${PROJECT_NAME} ALL
107 DEPENDS "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png" ${OCCT_OVERVIEW_FILES}
108 SOURCES ${OCCT_ARTICLES_ABSPATH}
109 VERBATIM
110)
111
112# Create Documentation folder in solution view
adc33035 113set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Documentation")