2013-10-25 13:19:54 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2015-05-11 20:00:30 +00:00
|
|
|
include(../i18n-tools/I18NTools.cmake)
|
2014-09-20 22:07:52 +00:00
|
|
|
|
|
|
|
set(HELP_INSTALL_DATA_DIR ${COLOBOT_INSTALL_DATA_DIR}/help)
|
|
|
|
|
|
|
|
##
|
|
|
|
# Add help category directory
|
|
|
|
##
|
2015-05-11 20:00:30 +00:00
|
|
|
function(add_help_category help_category_dir install_subdir)
|
|
|
|
|
2015-10-17 16:08:51 +00:00
|
|
|
# Always install English files
|
2015-05-11 20:00:30 +00:00
|
|
|
file(GLOB english_help_files ${help_category_dir}/E/*)
|
|
|
|
install(FILES ${english_help_files} DESTINATION ${HELP_INSTALL_DATA_DIR}/E/${install_subdir})
|
|
|
|
|
2015-10-17 16:08:51 +00:00
|
|
|
# If translations are turned on, also generate translated files
|
|
|
|
if(TRANSLATIONS)
|
|
|
|
message(STATUS "Adding translation targets for help/${help_category_dir}")
|
|
|
|
|
2015-05-11 20:00:30 +00:00
|
|
|
set(work_dir ${DATA_BINARY_DIR}/help-po/${help_category_dir})
|
|
|
|
generate_translations(translated_help_files
|
|
|
|
"help"
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${help_category_dir}
|
|
|
|
${help_category_dir}/po
|
|
|
|
${work_dir}
|
|
|
|
"${install_subdir}")
|
|
|
|
|
|
|
|
install_preserving_relative_paths("${translated_help_files}"
|
|
|
|
${work_dir}
|
|
|
|
${HELP_INSTALL_DATA_DIR})
|
2014-09-20 22:07:52 +00:00
|
|
|
endif()
|
2015-05-11 20:00:30 +00:00
|
|
|
|
2014-09-20 22:07:52 +00:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
2014-09-29 19:31:51 +00:00
|
|
|
add_help_category(bots "object")
|
|
|
|
add_help_category(cbot "cbot")
|
|
|
|
add_help_category(generic "")
|
|
|
|
add_help_category(object "object")
|
2016-06-17 19:15:15 +00:00
|
|
|
add_help_category(programs "programs")
|