if (BUILD_DOC)
find_package(Doxygen)
if (DOXYGEN_FOUND)
function(build_html lang out ver src top ex)
sed --expression="s:CHANGE_LANGUAGE:${lang}:" \
--expression="s:CHANGE_HTML_OUTPUT:${out}:" \
--expression="s:CHANGE_VERSION:${ver}:" \
--expression="s:CHANGE_INPUT:${src}:" \
--expression="s:CHANGE_OUTPUT:${top}:" \
--expression="s:CHANGE_EXAMPLE:${ex}:" \
doxygen/Doxyfile.in | ${DOXYGEN_EXECUTABLE} -
endfunction(build_html)
add_custom_target(doc_en
buld_html English html_en 0.1.0 inc doc example
COMMENT "Generate english documentation"
VERBATIM)
endif()
endif()
Вопрос - как решить проблему Parse error. Expected "(", got unquoted argument with text "--expression="s:CHANGE_LANGUAGE:${lang}:"".?
Спасибо.
sed "s:CHANGE_LANGUAGE:${lang}:;s:CHANGE_HTML_OUTPUT:${out}:;s:CHANGE_VERSION:${ver}:;s:CHANGE_INPUT:${src}:;s:CHANGE_OUTPUT:${top}:;s:CHANGE_EXAMPLE:${ex}:"
function(build_html lang out ver src top ex)
execute_process(COMMAND
sed "s:CHANGE_LANGUAGE:${lang}:;s:CHANGE_HTML_OUTPUT:${out}:;s:CHANGE_VERSION:${ver}:;s:CHANGE_INPUT:${src}:;s:CHANGE_OUTPUT:${top}:;s:CHANGE_EXAMPLE:${ex}:"
doxygen/Doxyfile.in | ${DOXYGEN_EXECUTABLE} -)
endfunction(build_html)
add_custom_target(doc_en
build_html English html_en 0.1.0 inc doc example
COMMENT "Generate english documentation"
VERBATIM)
function(build_html lang out ver src top ex)
execute_process(COMMAND
sed
"s:CHANGE_LANGUAGE:${lang}:;s:CHANGE_HTML_OUTPUT:${out}:;s:CHANGE_VERSION:${ver}:;s:CHANGE_INPUT:${src}:;s:CHANGE_OUTPUT:${top}:;s:CHANGE_EXAMPLE:${ex}:"
doxygen/Doxyfile.in | ${DOXYGEN_EXECUTABLE} -)
endfunction(build_html)
add_custom_target(doc_en
build_html(English html_en 0.1.0 inc doc example)
COMMENT "Generate english documentation"
VERBATIM)
В случае с sed, тот будет вызываться каждый раз при make doc, а при configure_file гарантировано при вызове cmake.
А будет ли каждый раз генериться(если добавить в DEPENDS/SOURCE) при вызове make не знаю.