summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2013-06-18 14:07:38 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2013-06-18 18:55:05 +0200
commit9ddf5fb757b47ff093ebf86394ccf9f4ea1d1691 (patch)
treeaca5d31b11c883ab69ed4f6a604ee49c8db85d4b /cmake
parentab786800d585e028a030109be4d169224ad08c66 (diff)
downloaddbus-9ddf5fb757b47ff093ebf86394ccf9f4ea1d1691.tar.gz
dbus-9ddf5fb757b47ff093ebf86394ccf9f4ea1d1691.tar.bz2
dbus-9ddf5fb757b47ff093ebf86394ccf9f4ea1d1691.zip
Fix of cmake xmldoc dependencies chain.
This patch fixes an issues that xml documentation is generated on all builds regardless if related files has been changed or not. The patch adds a global xmldoc make target to which all generated html or man files are added as build dependency. Each dependency itself depends on related CMakeLists.txt and the xml file generated from the related xml.in file. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=64058 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/doc/CMakeLists.txt19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt
index ae037561..bd1af17d 100644
--- a/cmake/doc/CMakeLists.txt
+++ b/cmake/doc/CMakeLists.txt
@@ -21,6 +21,7 @@ find_program(XMLTO_EXECUTABLE xmlto)
if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON)
+ ADD_CUSTOM_TARGET(xmldoc ALL)
endif (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE)
if (XMLTO_EXECUTABLE)
@@ -48,6 +49,7 @@ if (DBUS_ENABLE_XML_DOCS)
macro (DOCBOOK _sources _format)
get_filename_component(_infile ${_sources} ABSOLUTE)
get_filename_component(_name ${_infile} NAME)
+ set(_deps ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt)
if (${_format} STREQUAL "man")
string(REPLACE ".xml" "" _outname ${_name})
@@ -60,16 +62,18 @@ macro (DOCBOOK _sources _format)
set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname})
if (EXISTS ${_sources})
if (MEINPROC4_EXECUTABLE)
- ADD_CUSTOM_TARGET(${_outname} ALL
- ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
- DEPENDS ${_infile}
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_outfile}
+ COMMAND ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
+ DEPENDS ${_infile} ${STYLESHEET} ${_deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif ()
if (XMLTO_EXECUTABLE)
- ADD_CUSTOM_TARGET(${_outname} ALL
- ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}
- DEPENDS ${_infile}
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_outfile}
+ COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile}
+ DEPENDS ${_infile} ${_deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif ()
@@ -81,7 +85,8 @@ macro (DOCBOOK _sources _format)
else ()
MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found")
endif ()
-
+ ADD_CUSTOM_TARGET(${_outname} DEPENDS ${_outfile})
+ ADD_DEPENDENCIES(xmldoc ${_outname})
endmacro (DOCBOOK)
### copy tests to builddir so that generated tests and static tests