summaryrefslogtreecommitdiff
path: root/tools/CMakeLists.txt
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2012-05-24 12:50:03 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2012-05-24 12:50:03 -0700
commit09cdaf8ce729b99c134c5a01ad7ab081fa7d5b8d (patch)
tree7dbaf1b0ccf1805e8821caf8aaee9fd9471c66db /tools/CMakeLists.txt
parent7a74c3574afb32ab31dc5f946afbf89f3022a36d (diff)
parent16341eb2140c848bd549a112960164bd11924e85 (diff)
downloadrabbitmq-c-github-ask-09cdaf8ce729b99c134c5a01ad7ab081fa7d5b8d.tar.gz
Merge pull request #20 from alanxz/cmake_build_improvements
CMake build system improvements
Diffstat (limited to 'tools/CMakeLists.txt')
-rw-r--r--tools/CMakeLists.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index bdeddaf..cf7f4e2 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -32,3 +32,47 @@ target_link_libraries(amqp-declare-queue rabbitmq ${POPT_LIBRARY})
add_executable(amqp-delete-queue delete_queue.c ${COMMON_SRCS})
target_link_libraries(amqp-delete-queue rabbitmq ${POPT_LIBRARY})
+if (BUILD_TOOLS_DOCS)
+ if (XmlTo_FOUND)
+ set(DOCS_SRCS
+ doc/amqp-consume.xml
+ doc/amqp-declare-queue.xml
+ doc/amqp-delete-queue.xml
+ doc/amqp-get.xml
+ doc/amqp-publish.xml
+ doc/librabbitmq-tools.xml
+ )
+
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
+ set(XMLTO_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc/man-date.ent)
+ add_custom_command(
+ OUTPUT ${XMLTO_DEPENDS}
+ COMMAND date +'%Y-%m-%d' > ${XMLTO_DEPENDS}
+ VERBATIM
+ )
+
+ set(XMLTO_COMMAND_ARGS --skip-validation --searchpath "${CMAKE_CURRENT_BINARY_DIR}/doc")
+
+ XMLTO(${DOCS_SRCS}
+ MODES man
+ ALL)
+
+ foreach(file ${XMLTO_FILES_man})
+ get_filename_component(fileExt ${file} EXT)
+ string( REGEX REPLACE "^[.]" "" fileExt ${fileExt} )
+ install(
+ FILES ${file}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man${fileExt}
+ )
+ endforeach()
+
+ else(XmlTo_FOUND)
+ message(WARNING "xmlto not found, will not build tools documentation")
+ endif(XmlTo_FOUND)
+endif()
+
+install(TARGETS amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ PUBLIC_HEADER DESTINATION include)