From 67fd00b35aabe932cff75d1945b26db7020d1ec6 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 28 Mar 2012 13:08:23 +0200 Subject: [PATCH 1/1] doc: fix the "custom install targets" to handle DESTDIR Stuff has to be installed/copied in an actual "install" target for Cmake to handle DESTDIR sanely, a custom target is not enough. So the story now is: - add a component-local install rule - make the "custom install target" invoke it - make sure the custom target has been executed at install time Maybe all this is not even worth the effort anymore and the "custom install targets" could go away altogether, their point was to have _them_ invoke at install time end exploit the dependencies chain. --- doc/CMakeLists.txt | 12 +++++++----- doc/man/CMakeLists.txt | 19 +++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 5a7d9cb..6ccf100 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -10,13 +10,15 @@ if(DOXYGEN_FOUND) ) add_custom_target(install-doc - ${CMAKE_COMMAND} -E copy_directory - ${DOC_OUTPUT_PATH}/html - "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}/html" - ) + COMMAND ${CMAKE_COMMAND} -DCOMPONENT=doc -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + COMMENT "Installing API documentation") add_dependencies(install-doc doc) - install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} install-doc)") + install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} doc)") + + install(DIRECTORY ${DOC_OUTPUT_PATH}/html + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/${CMAKE_PROJECT_NAME}" + COMPONENT doc) endif(DOXYGEN_FOUND) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt index 17549bf..ed46999 100644 --- a/doc/man/CMakeLists.txt +++ b/doc/man/CMakeLists.txt @@ -9,17 +9,16 @@ if(ASCIIDOC_FOUND) ) add_custom_target(install-manpages - ${CMAKE_COMMAND} -E make_directory - "${CMAKE_INSTALL_PREFIX}/share/man/man1/" - COMMAND ${CMAKE_COMMAND} -E copy - ${DOC_OUTPUT_PATH}/man/am7xxx-play.1 - "${CMAKE_INSTALL_PREFIX}/share/man/man1/" - COMMAND ${CMAKE_COMMAND} -E copy - ${DOC_OUTPUT_PATH}/man/picoproj.1 - "${CMAKE_INSTALL_PREFIX}/share/man/man1/" - ) + COMMAND ${CMAKE_COMMAND} -DCOMPONENT=manpages -P ${CMAKE_BINARY_DIR}/cmake_install.cmake + COMMENT "Installing manpages") add_dependencies(install-manpages manpages) - install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} install-manpages)") + install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} manpages)") + + install(FILES + ${DOC_OUTPUT_PATH}/man/am7xxx-play.1 + ${DOC_OUTPUT_PATH}/man/picoproj.1 + DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/" + COMPONENT manpages) endif(ASCIIDOC_FOUND) -- 2.1.4