Warning, /multimedia/kwave/cmake/KwaveHandbook.cmake is written in an unsupported language. File is not indexed.

0001 #############################################################################
0002 ##    Kwave                - cmake/KwaveHandbook.cmake
0003 ##                           -------------------
0004 ##    begin                : Wed Feb 18 2015
0005 ##    copyright            : (C) 2015 by Thomas Eschenbacher
0006 ##    email                : Thomas.Eschenbacher@gmx.de
0007 #############################################################################
0008 #
0009 #############################################################################
0010 #                                                                           #
0011 # Redistribution and use in source and binary forms, with or without        #
0012 # modification, are permitted provided that the following conditions        #
0013 # are met:                                                                  #
0014 #                                                                           #
0015 # 1. Redistributions of source code must retain the above copyright         #
0016 #    notice, this list of conditions and the following disclaimer.          #
0017 # 2. Redistributions in binary form must reproduce the above copyright      #
0018 #    notice, this list of conditions and the following disclaimer in the    #
0019 #    documentation and/or other materials provided with the distribution.   #
0020 #                                                                           #
0021 # For details see the accompanying cmake/COPYING-CMAKE-SCRIPTS file.        #
0022 #                                                                           #
0023 #############################################################################
0024 
0025 # auto detect this language (to make this file re-usable)
0026 GET_FILENAME_COMPONENT(_lang ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
0027 
0028 # /usr/share/help/de/kdoctools5-common
0029 SET(_common_dir ${CMAKE_INSTALL_PREFIX}/share/help/${_lang}/kdoctools5-common)
0030 SET(_common_en_dir ${CMAKE_INSTALL_PREFIX}/share/help/en/kdoctools5-common)
0031 SET(_html_dir ${CMAKE_BINARY_DIR}/doc/html/${_lang})
0032 
0033 #############################################################################
0034 ### png files with the toolbar icons                                      ###
0035 
0036 FILE(GLOB _toolbar_icons "${CMAKE_SOURCE_DIR}/kwave/toolbar/*.svgz")
0037 FOREACH(_toolbar_icon ${_toolbar_icons})
0038     GET_FILENAME_COMPONENT(_svgz_file ${_toolbar_icon} NAME)
0039     STRING(REPLACE "sc-actions-" "" _svgz_file_base ${_svgz_file})
0040     STRING(REPLACE ".svgz" ".png" _png_file ${_svgz_file_base})
0041     SET(_toolbar_png ${CMAKE_CURRENT_BINARY_DIR}/toolbar_${_png_file})
0042     SVG2PNG(${_toolbar_icon} ${_toolbar_png} ${_png_file})
0043     SET(_toolbar_pngs "${_toolbar_pngs}" "${_toolbar_png}")
0044 ENDFOREACH(_toolbar_icon ${_toolbar_icons})
0045 
0046 #############################################################################
0047 ### "make html_doc"                                                       ###
0048 
0049 FILE(GLOB _docbook_files "${CMAKE_CURRENT_SOURCE_DIR}/*.docbook")
0050 FILE(GLOB _png_files "${CMAKE_SOURCE_DIR}/doc/${_lang}/*.png")
0051 GET_TARGET_PROPERTY(MEINPROC_EXECUTABLE ${KDOCTOOLS_MEINPROC_EXECUTABLE} LOCATION)
0052 
0053 ADD_CUSTOM_TARGET(html_doc_${_lang}
0054     COMMENT "Generating HTML documentation for ${_lang}"
0055     DEPENDS ${_toolbar_pngs}
0056     DEPENDS ${_docbook_files}
0057     # start with an empty output (_html_dir)
0058     COMMAND ${CMAKE_COMMAND} -E remove_directory ${_html_dir}
0059     COMMAND ${CMAKE_COMMAND} -E make_directory ${_html_dir}
0060     # create the HTML pages from docbook
0061     COMMAND cd ${_html_dir} && ${MEINPROC_EXECUTABLE}
0062             --check ${CMAKE_CURRENT_SOURCE_DIR}/index.docbook
0063     # copy the screenshots and converted toolbar icons
0064     COMMAND test -z \"${_png_files}\" || ${CP_EXECUTABLE} ${_png_files} ${_html_dir}
0065     COMMAND ${CP_EXECUTABLE} ${_toolbar_pngs}                           ${_html_dir}
0066     # take missing images from the English source directory
0067     COMMAND ${CP_EXECUTABLE} -n ${CMAKE_SOURCE_DIR}/doc/en/*.png        ${_html_dir}
0068     # copy files for the "common" directory
0069     COMMAND ${CMAKE_COMMAND} -E make_directory      ${_html_dir}/common
0070     COMMAND ${CP_EXECUTABLE} ${_common_dir}/*       ${_html_dir}/common/
0071     COMMAND ${CP_EXECUTABLE} -n ${_common_en_dir}/* ${_html_dir}/common/
0072     # fix wrong paths in the HTML pages
0073     COMMAND cd ${_html_dir} && ${CMAKE_SOURCE_DIR}/doc/fix-common
0074     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
0075 )
0076 
0077 ADD_DEPENDENCIES(html_doc html_doc_${_lang})
0078 
0079 #############################################################################
0080 ### generate and install the icons                                        ###
0081 
0082 ADD_CUSTOM_TARGET(generate_icons_${_lang}
0083     ALL
0084     DEPENDS ${_toolbar_pngs}
0085     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
0086 )
0087 INSTALL(FILES
0088     ${_toolbar_pngs}
0089     DESTINATION ${HTML_INSTALL_DIR}/${_lang}/kwave/
0090 )
0091 
0092 #############################################################################
0093 ### generate the handbook, KDE environment                                ###
0094 
0095 KDOCTOOLS_CREATE_HANDBOOK(
0096     index.docbook
0097     INSTALL_DESTINATION ${HTML_INSTALL_DIR}/${_lang}
0098     SUBDIR kwave
0099 )
0100 
0101 #############################################################################
0102 #############################################################################