|
Lines 123-129
endif ()
a/Source/cmake/FindGIDocgen.cmake_sec1
|
| 123 |
|
123 |
|
| 124 |
.. code-block:: cmake |
124 |
.. code-block:: cmake |
| 125 |
|
125 |
|
| 126 |
GI_DOCGEN(<namespace> <toml-file>) |
126 |
GI_DOCGEN(<namespace> <toml-file> |
|
|
127 |
[CONTENT_TEMPLATES <file...>]) |
| 127 |
|
128 |
|
| 128 |
Configures generating documentation for a GObject-Introspection |
129 |
Configures generating documentation for a GObject-Introspection |
| 129 |
``<namespace>``, which needs to have been previously configured using |
130 |
``<namespace>``, which needs to have been previously configured using |
|
Lines 136-141
endif ()
a/Source/cmake/FindGIDocgen.cmake_sec2
|
| 136 |
|
137 |
|
| 137 |
__ https://gnome.pages.gitlab.gnome.org/gi-docgen/project-configuration.html |
138 |
__ https://gnome.pages.gitlab.gnome.org/gi-docgen/project-configuration.html |
| 138 |
|
139 |
|
|
|
140 |
``CONTENT_TEMPLATES`` can be used to list files, for each of them a |
| 141 |
template with the ``.in`` suffix will be expanded using the |
| 142 |
command:`configure_file` in ``@ONLY`` mode. The ``.in`` sufix must |
| 143 |
not be present. |
| 144 |
|
| 139 |
Documentation is generated in the ``Documentation/<pkgname>-<nsversion>/`` |
145 |
Documentation is generated in the ``Documentation/<pkgname>-<nsversion>/`` |
| 140 |
subdirectory by the ``doc-<namespace>`` target added by the command. |
146 |
subdirectory by the ``doc-<namespace>`` target added by the command. |
| 141 |
Additionally, a ``doc-check-<namespace>`` target is created as well, |
147 |
Additionally, a ``doc-check-<namespace>`` target is created as well, |
|
Lines 147-152
endif ()
a/Source/cmake/FindGIDocgen.cmake_sec3
|
| 147 |
|
153 |
|
| 148 |
#]=======================================================================] |
154 |
#]=======================================================================] |
| 149 |
function(GI_DOCGEN namespace toml) |
155 |
function(GI_DOCGEN namespace toml) |
|
|
156 |
cmake_parse_arguments(PARSE_ARGV 1 opt |
| 157 |
"" |
| 158 |
"" |
| 159 |
"CONTENT_TEMPLATES" |
| 160 |
) |
| 150 |
if (NOT TARGET "gir-${namespace}") |
161 |
if (NOT TARGET "gir-${namespace}") |
| 151 |
message(FATAL_ERROR |
162 |
message(FATAL_ERROR |
| 152 |
"Introspection not configured for '${namespace}'. " |
163 |
"Introspection not configured for '${namespace}'. " |
|
Lines 154-161
function(GI_DOCGEN namespace toml)
a/Source/cmake/FindGIDocgen.cmake_sec4
|
| 154 |
) |
165 |
) |
| 155 |
endif () |
166 |
endif () |
| 156 |
|
167 |
|
|
|
168 |
set(contentdir "${CMAKE_BINARY_DIR}/GIDocgenGenerated/${namespace}") |
| 169 |
|
| 157 |
get_property(gir_path TARGET "gir-${namespace}" PROPERTY GI_GIR_PATH) |
170 |
get_property(gir_path TARGET "gir-${namespace}" PROPERTY GI_GIR_PATH) |
| 158 |
set(toml_path "${CMAKE_BINARY_DIR}/${namespace}.toml") |
171 |
set(toml_path "${contentdir}.toml") |
| 159 |
configure_file("${toml}" "${toml_path}" @ONLY) |
172 |
configure_file("${toml}" "${toml_path}" @ONLY) |
| 160 |
|
173 |
|
| 161 |
get_filename_component(toml_dir "${toml}" DIRECTORY) |
174 |
get_filename_component(toml_dir "${toml}" DIRECTORY) |
|
Lines 167-172
function(GI_DOCGEN namespace toml)
a/Source/cmake/FindGIDocgen.cmake_sec5
|
| 167 |
endif () |
180 |
endif () |
| 168 |
set(outdir "${CMAKE_BINARY_DIR}/Documentation/${package}") |
181 |
set(outdir "${CMAKE_BINARY_DIR}/Documentation/${package}") |
| 169 |
|
182 |
|
|
|
183 |
set(docdeps "${toml_path};${gir_path}") |
| 184 |
foreach (item IN LISTS opt_CONTENT_TEMPLATES) |
| 185 |
get_filename_component(filename "${item}" NAME) |
| 186 |
configure_file("${item}.in" "${contentdir}/${filename}" @ONLY) |
| 187 |
list(APPEND docdeps "${contentdir}/${filename}") |
| 188 |
endforeach () |
| 189 |
|
| 170 |
set(common_flags) |
190 |
set(common_flags) |
| 171 |
list(APPEND common_flags |
191 |
list(APPEND common_flags |
| 172 |
--quiet |
192 |
--quiet |
|
Lines 179-189
function(GI_DOCGEN namespace toml)
a/Source/cmake/FindGIDocgen.cmake_sec6
|
| 179 |
OUTPUT "${outdir}/index.html" |
199 |
OUTPUT "${outdir}/index.html" |
| 180 |
COMMENT "Generating documentation: ${namespace}" |
200 |
COMMENT "Generating documentation: ${namespace}" |
| 181 |
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" |
201 |
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" |
| 182 |
DEPENDS "${toml_path}" "${gir_path}" |
202 |
DEPENDS ${docdeps} |
| 183 |
VERBATIM |
203 |
VERBATIM |
| 184 |
COMMAND "${GIDocgen_EXE}" generate |
204 |
COMMAND "${GIDocgen_EXE}" generate |
| 185 |
${common_flags} |
205 |
${common_flags} |
| 186 |
--no-namespace-dir |
206 |
--no-namespace-dir |
|
|
207 |
--content-dir "${contentdir}" |
| 187 |
--content-dir "${toml_dir}" |
208 |
--content-dir "${toml_dir}" |
| 188 |
--output-dir "${outdir}" |
209 |
--output-dir "${outdir}" |
| 189 |
--config "${toml_path}" |
210 |
--config "${toml_path}" |