1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 15:19:44 +02:00
audacity/help/CMakeLists.txt
lmarz 198d49b773
Rename freedesktop and metainfo files to reverse DNS schema
Based on the suggestion made by Mart Raudsepp.

"Regular installs should have reverse DNS notation desktop and
metainfo files as well. This becomes important if we ever make use
of things like dbus service activation further down the line. And
renaming it then will break peoples app shortcuts and other things."

Signed-off-by: Leon Marz <main@lmarz.org>
Signed-off-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
Helped-by: Mart Raudsepp <leio@gentoo.org>
Reference-to: https://github.com/tenacityteam/tenacity/pull/642
2021-09-27 05:49:51 +00:00

76 lines
2.3 KiB
CMake
Executable File

set( TARGET manual )
set( TARGET_ROOT ${CMAKE_SOURCE_DIR}/manual )
message( STATUS "========== Configuring ${TARGET} ==========" )
def_vars()
if( NOT DEFINED PYTHON )
message( WARNING "Python not found...unable to produce manual." )
return()
endif()
set( host "alphamanual.audacityteam.org" )
set( src "https://${host}/man" )
set( dst "${_DEST}/help/manual" )
set( script_dir "${CMAKE_SOURCE_DIR}/scripts/mw2html_audacity" )
set( script "mw2html.py" )
set( out_dir "${_INTDIR}" )
set( out "${out_dir}/${host}/index.html" )
add_custom_command(
COMMENT
"Downloading manual from: ${src}"
COMMAND
"${PYTHON}" "${script_dir}/${script}" -s "${src}" "${out_dir}"
COMMAND
${CMAKE_COMMAND} -E copy_directory "${out_dir}/${host}" "${dst}"
WORKING_DIRECTORY
"${script_dir}"
OUTPUT
"${out}"
)
add_custom_target( ${TARGET} DEPENDS "${out}" )
if( ${_OPT}package_manual )
install(CODE " \
execute_process( \
COMMAND \
${CMAKE_COMMAND} \
--build ${CMAKE_BINARY_DIR} \
--config \${CMAKE_INSTALL_CONFIG_NAME} \
--target manual \
) \
")
install( DIRECTORY "${out_dir}/${host}/" DESTINATION "help/manual" )
endif()
if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
if( NOT WIN32)
install( DIRECTORY "${dst}" OPTIONAL
DESTINATION "${_DATADIR}/tenacity/help" )
install( FILES "${_SRCDIR}/org.tenacityaudio.Tenacity.metainfo.xml"
DESTINATION "${_DATADIR}/metainfo" )
endif()
endif()
# Test if scdoc is installed
find_program(SCDOC_CMD scdoc)
cmake_dependent_option(BUILD_MANPAGE "Build manpage" ON "NOT SCDOC_CMD STREQUAL SCDOC_CMD-NOTFOUND" OFF)
if( BUILD_MANPAGE )
add_custom_command( COMMENT "Generating manpage"
COMMAND ${SCDOC_CMD} < "${_SRCDIR}/tenacity.1.scd" > "${CMAKE_BINARY_DIR}/help/tenacity.1"
DEPENDS "${_SRCDIR}/tenacity.1.scd"
OUTPUT "${CMAKE_BINARY_DIR}/help/tenacity.1" )
add_custom_target( gen_manpage ALL DEPENDS "${CMAKE_BINARY_DIR}/help/tenacity.1")
install( FILES "${CMAKE_BINARY_DIR}/help/tenacity.1"
DESTINATION "${_MANDIR}/man1" )
endif()