diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2022-12-13 00:23:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2022-12-13 00:44:38 +0100 |
commit | b02fdb4d705016a6c8e83f9d492b8df7c531b805 (patch) | |
tree | 766b40d911fbf23ef6c9ea8f41b4e523c7cf9503 /doc/man/CMakeLists.txt | |
parent | facdbc2fcef5f9bfbd56c1eef53e61eb8e7438a1 (diff) | |
download | bibletime-b02fdb4d705016a6c8e83f9d492b8df7c531b805.tar.gz bibletime-b02fdb4d705016a6c8e83f9d492b8df7c531b805.zip |
Conversion to CMake build system.
Remove the generated files from the source tree.
Copy translations to a new directory layout.
Added translation of .desktop files.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'doc/man/CMakeLists.txt')
-rw-r--r-- | doc/man/CMakeLists.txt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt new file mode 100644 index 0000000..60c7e44 --- /dev/null +++ b/doc/man/CMakeLists.txt @@ -0,0 +1,42 @@ + +file( GLOB_RECURSE _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * ) +unset( _dirs ) +foreach( _man_file IN LISTS _man_files ) + get_filename_component( _dir ${_man_file} PATH ) + list( APPEND _dirs ${_dir} ) +endforeach() +if( _dirs ) + list( SORT _dirs ) + list( REMOVE_DUPLICATES _dirs ) +endif() + +string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" ) + +foreach( _dir IN LISTS _dirs ) + string( REGEX REPLACE "/.*" "" _lang ${_dir} ) + if( ${_lang} STREQUAL "en" OR + "${_linguas}" MATCHES "^;*$" OR + ";${_linguas};" MATCHES ";${_lang};" ) + + file( GLOB_RECURSE _man_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_lang}/* ) + foreach( _man_file IN LISTS _man_files ) + if( ${_man_file} MATCHES "\\.[0-9]$" ) + string( REGEX REPLACE ".*\\.([0-9])$" "\\1" _man_section "${_man_file}" ) + list( APPEND _man_files_${_man_section} "${_man_file}" ) + list( APPEND _man_sections "${_man_section}" ) + endif() + endforeach() + if( ${_lang} STREQUAL "en" ) + set( _lang_dir "" ) + else() + set( _lang_dir "/${_lang}" ) + endif() + foreach( _man_section IN LISTS _man_sections ) + INSTALL( + FILES ${_man_files_${_man_section}} + DESTINATION ${MAN_INSTALL_DIR}${_lang_dir}/man${_man_section} + COMPONENT doc + ) + endforeach() + endif() +endforeach() |