aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <winter@kde.org>2007-09-26 15:38:26 +0000
committerAllen Winter <winter@kde.org>2007-09-26 15:38:26 +0000
commit8a5e72cd3f863ecfe04017d289874193f311cab2 (patch)
tree44aef992d0987b67fac4cfe68321d92409f3227e
parent1deb8975ca3e58dae49b595e25d5f78950bea9d8 (diff)
downloadextra-cmake-modules-8a5e72cd3f863ecfe04017d289874193f311cab2.tar.gz
extra-cmake-modules-8a5e72cd3f863ecfe04017d289874193f311cab2.tar.bz2
Changes to the KDE4_CREATE_MANPAGE() macro:
- the section argument is now required - the output roff file goes into the builddir - now provides optional INSTALL_DESTINATION arguments, just like KDE4_CREATE_HANDBOOK() svn path=/trunk/KDE/kdelibs/; revision=717306
-rw-r--r--modules/KDE4Macros.cmake32
1 files changed, 26 insertions, 6 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 8387c98b..0ce4961e 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -315,15 +315,11 @@ macro (KDE4_CREATE_HANDBOOK _docbook)
endmacro (KDE4_CREATE_HANDBOOK)
-macro (KDE4_CREATE_MANPAGE _docbook) # _section
+macro (KDE4_CREATE_MANPAGE _docbook _section)
get_filename_component(_input ${_docbook} ABSOLUTE)
get_filename_component(_base ${_input} NAME_WE)
- set(_section "${ARGV1}")
- if (NOT ${_section})
- set(_section "1")
- endif(NOT ${_section})
- set(_doc ${CMAKE_CURRENT_SOURCE_DIR}/${_base}.${_section})
+ set(_doc ${CMAKE_CURRENT_BINARY_DIR}/${_base}.${_section})
#Bootstrap
if (_kdeBootStrapping)
@@ -339,6 +335,30 @@ macro (KDE4_CREATE_MANPAGE _docbook) # _section
DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
)
add_custom_target(manpage ALL DEPENDS ${_doc})
+
+ set(_args ${ARGN})
+
+ set(_installDest)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ list(GET _args 1 _installDest )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ endif(_args)
+
+ get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "SUBDIR")
+ list(GET _args 1 dirname )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "SUBDIR")
+ endif(_args)
+
+ if(_installDest)
+ install(FILES ${_doc} DESTINATION ${_installDest}/man${_section})
+ endif(_installDest)
endmacro (KDE4_CREATE_MANPAGE)