git-svn-id: svn://db.shs.com.ru/libs@920 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
# * Qt<4/5>_ROOT var to Qt root dir
|
||||
# * Qt<4/5>_BIN var to Qt binary dir
|
||||
# * Qt<4/5>_PLUGINS_DIR var to Qt plugins dir
|
||||
# * Qt<4/5>_LANG_DIR var to Qt translations dir
|
||||
#
|
||||
#
|
||||
#
|
||||
@@ -89,6 +90,16 @@
|
||||
# e.g. "qt_install(LANG my_QM DESTINATION QtLang)"
|
||||
#
|
||||
#
|
||||
#
|
||||
#
|
||||
# qt_install_lang(<name> DESTINATION <dir>)
|
||||
#
|
||||
# Search Qt translations for all <name> dependencies
|
||||
# in Qt<?>_LANG_DIR for <name>_LANG languages
|
||||
# and install them to <dir>. You can you "set_lang()" macro
|
||||
# before this action
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
cmake_policy(SET CMP0011 NEW) # don`t affect includer policies
|
||||
@@ -624,3 +635,46 @@ macro(qt_install)
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(qt_install_lang _NAME _dest_tag _DEST)
|
||||
set(_prev_inst)
|
||||
#message("command: ${ARGN}")
|
||||
foreach(_v ${_QT_VERSIONS_})
|
||||
if (LOCAL_FOUND${_v})
|
||||
set(_target)
|
||||
if (_${_NAME}_is_qt)
|
||||
set(_target ${_NAME}${TARGET_SUFFIX_Qt${_v}})
|
||||
endif()
|
||||
get_target_property(_LL ${_target} LINK_LIBRARIES)
|
||||
foreach (_L ${_LL})
|
||||
get_filename_component(_libname "${_L}" NAME)
|
||||
#message("depend on ${_libname}")
|
||||
if ("${_libname}" MATCHES "Qt${_v}::.*")
|
||||
string(SUBSTRING "${_libname}" 5 -1 _libname)
|
||||
string(TOLOWER "${_libname}" _libname)
|
||||
#message("qt lib \"${_libname}\"")
|
||||
list(APPEND _qt_libs qt${_libname})
|
||||
elseif ("${_libname}" MATCHES "qad_.*${_v}")
|
||||
string(LENGTH ${_libname} _sl)
|
||||
math(EXPR _sl ${_sl}-1)
|
||||
string(SUBSTRING ${_libname} 0 ${_sl} _libname)
|
||||
#message("qad lib \"${_libname}\"")
|
||||
list(APPEND _qt_libs ${_libname})
|
||||
endif()
|
||||
endforeach()
|
||||
if (NOT "x${_qt_libs}" STREQUAL "x")
|
||||
list(APPEND _qt_libs "qtbase")
|
||||
foreach (_i ${${PROJECT_NAME}_LANG})
|
||||
foreach (_l ${_qt_libs})
|
||||
set(_qm_path "${Qt${_v}_LANG_DIR}/${_l}_${_i}.qm")
|
||||
if (EXISTS "${_qm_path}")
|
||||
install(FILES ${_qm_path} DESTINATION "${_DEST}")
|
||||
#message("qm = \"${_qm_path}\"")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
Reference in New Issue
Block a user