1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00
audacity/help/CMakeLists.txt
Leland Lucius f0e3ee2cde More cmake updates
Added install target (this is mainly for Linux)
Added mod-nyq-bench

More to come...
2020-02-06 01:17:20 -06:00

58 lines
1.5 KiB
CMake
Executable File

set( TARGET manual )
set( TARGET_ROOT ${topdir}/manual )
message( STATUS "========== Configuring ${TARGET} ==========" )
def_vars()
set( host "alphamanual.audacityteam.org" )
set( src "https://${host}/man" )
set( dst "${_DEST}/help/manual" )
set( script_dir "${topdir}/scripts/mw2html_audacity" )
set( script "mw2html.py" )
set( out_dir "${_INTDIR}" )
set( out "${out_dir}/${host}/index.html" )
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
file( TO_NATIVE_PATH
"${CMAKE_BINARY_DIR}/packages/${PYTHON_NAME}.${PYTHON_VERSION}/tools/python.exe"
python
)
else()
find_package( Python2 )
if( Python2_FOUND )
set( python "${Python2_EXECUTABLE}" )
endif()
endif()
if( NOT DEFINED python )
message( WARNING "Python not found...unable to produce manual." )
return()
endif()
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( NOT "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
install( DIRECTORY "${dst}" OPTIONAL
DESTINATION "${_DATADIR}/audacity/help" )
install( FILES "${_SRCDIR}/audacity.1"
DESTINATION "${_DATADIR}/man/man.1" )
install( FILES "${_SRCDIR}/audacity.appdata.xml"
DESTINATION "${_DATADIR}/appdata" )
endif()